* fhandler.cc (fhandler_base::wait_overlapped): Always assume that bytes will

be non-NULL.  Distinguish input result from result derived from WFMO and
GetOverlappedResult or res can never be -1.  Only raise SIGPIPE when writing.
* fhandler.h (fhandler_base::wait_overlapped): Pass first argument by value.
* fhandler_fifo.cc (fhandler_fifo::wait): Pass in dummy byte count to
wait_overlapped.
* pipe.cc (DEFAULT_PIPEBUFSIZE): Define to 65536 explicitly.
This commit is contained in:
Christopher Faylor
2008-08-20 02:25:06 +00:00
parent ec8a7e416f
commit fbf39a58cb
5 changed files with 27 additions and 15 deletions

View File

@ -132,9 +132,10 @@ fhandler_fifo::wait (bool iswrite)
{
case fifo_wait_for_client:
bool res = ConnectNamedPipe (get_handle (), get_overlapped ());
DWORD dummy_bytes;
if (res || GetLastError () == ERROR_PIPE_CONNECTED)
return true;
return wait_overlapped (res, iswrite, NULL);
return wait_overlapped (res, iswrite, &dummy_bytes);
default:
break;
}