ntdll: Don't consider a 0-byte read from a serial port as a broken pipe.

This commit is contained in:
Alexandre Julliard 2008-05-07 20:18:09 +02:00
parent b1ace4490e
commit 152d65c6f3
1 changed files with 15 additions and 3 deletions

View File

@ -599,10 +599,22 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
if (!result || total == length)
{
if (total)
{
status = STATUS_SUCCESS;
else
status = (type == FD_TYPE_FILE || type == FD_TYPE_CHAR) ? STATUS_END_OF_FILE : STATUS_PIPE_BROKEN;
goto done;
goto done;
}
switch (type)
{
case FD_TYPE_FILE:
case FD_TYPE_CHAR:
status = STATUS_END_OF_FILE;
goto done;
case FD_TYPE_SERIAL:
break;
default:
status = STATUS_PIPE_BROKEN;
goto done;
}
}
}
else