From 6ef31d2336b2a7b3eed261c095ccb91230729033 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 22 Dec 2008 19:18:00 +0000 Subject: * pipe.cc (getov_result): Minor cleanup. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/pipe.cc | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin') diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9ce596289..e40be0aab 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2008-12-22 Christopher Faylor + + * pipe.cc (getov_result): Minor cleanup. + 2008-12-20 Christopher Faylor * pipe.cc (getov_result): Add parameters to facilitate better EOF diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 5b5a55aa6..cfc3f0410 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -42,7 +42,7 @@ inline bool getov_result (BOOL res, bool reading, HANDLE h, DWORD& nbytes, LPOVERLAPPED ov) { DWORD err = GetLastError (); - if (res || (reading && ov && !res && err == ERROR_HANDLE_EOF)) + if (res || (reading && ov && err == ERROR_HANDLE_EOF)) /* not an error */; else if (!ov || (err != ERROR_IO_PENDING) || (!GetOverlappedResult (h, ov, &nbytes, true) @@ -70,7 +70,6 @@ pipe_handler (LPVOID in_ps) SetHandleInformation (h, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT); SetEvent (ps.ev); - char buf[4096]; DWORD read_bytes, write_bytes; HANDLE hread, hwrite, hclose; OVERLAPPED ov, *rov, *wov; @@ -91,6 +90,7 @@ pipe_handler (LPVOID in_ps) wov = NULL; } + char buf[4096]; while (1) { ResetEvent (ov.hEvent); @@ -151,7 +151,6 @@ out: CloseHandle (ev); ev = NULL; } - return; } void -- cgit v1.2.3