Don't return from overlapped ReadFile on EAGAIN and other non-fatal

errors.
oldstable
Mike McCormack 2001-12-21 19:16:33 +00:00 committed by Alexandre Julliard
parent 365a6d2ee5
commit 5d754fc958
1 changed files with 8 additions and 2 deletions

View File

@ -1454,10 +1454,16 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
close(unix_handle); close(unix_handle);
if(result<0) if(result<0)
{
if( (errno!=EAGAIN) && (errno!=EINTR) &&
((errno != EFAULT) || IsBadWritePtr( buffer, bytesToRead )) )
{ {
FILE_SetDosError(); FILE_SetDosError();
return FALSE; return FALSE;
} }
else
result = 0;
}
/* if we read enough to keep the app happy, then return now */ /* if we read enough to keep the app happy, then return now */
if(result>=bytesToRead) if(result>=bytesToRead)