Module: wine Branch: master Commit: 152d65c6f34c9973e6d6acece883443746e9b78a URL: http://source.winehq.org/git/wine.git/?a=commit;h=152d65c6f34c9973e6d6acece8...
Author: Alexandre Julliard julliard@winehq.org Date: Wed May 7 20:18:09 2008 +0200
ntdll: Don't consider a 0-byte read from a serial port as a broken pipe.
---
dlls/ntdll/file.c | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index fd72a61..972d600 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -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