From 240bdacb8d79a9b820120babb0da018c30e0a62d Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Thu, 1 Apr 1999 11:53:52 +0000 Subject: [PATCH] Made DOSVM_GetTimer survive EAGAIN errors... --- loader/dos/dosvm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/loader/dos/dosvm.c b/loader/dos/dosvm.c index e2e4cd457c..3e79361469 100644 --- a/loader/dos/dosvm.c +++ b/loader/dos/dosvm.c @@ -523,9 +523,11 @@ unsigned DOSVM_GetTimer( void ) return 0; } /* read response */ - if (read(pModule->lpDosTask->read_pipe,&tim,sizeof(tim))!=sizeof(tim)) { - ERR(module,"dosmod sync lost, errno=%d\n",errno); - return 0; + while (1) { + if (read(pModule->lpDosTask->read_pipe,&tim,sizeof(tim))==sizeof(tim)) break; + if ((errno==EINTR)||(errno==EAGAIN)) continue; + ERR(module,"dosmod sync lost, errno=%d\n",errno); + return 0; } return ((unsigned long long)tim.tv_usec*1193180)/1000000; }