Merge pull request #1902 from hardening/pipeFix

Don't forget to SetLastError() on disconnection
This commit is contained in:
Hardening 2014-06-18 17:01:09 +02:00
commit bf30d54fac

View File

@ -368,12 +368,7 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
if (io_status == 0)
{
switch (errno)
{
case ECONNRESET:
SetLastError(ERROR_BROKEN_PIPE);
break;
}
SetLastError(ERROR_BROKEN_PIPE);
status = FALSE;
}
else if (io_status < 0)
@ -385,6 +380,9 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
case EWOULDBLOCK:
SetLastError(ERROR_NO_DATA);
break;
default:
SetLastError(ERROR_BROKEN_PIPE);
break;
}
}