diff options
author | Christopher Faylor <me@cgf.cx> | 2008-08-22 08:06:01 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2008-08-22 08:06:01 +0400 |
commit | 8b2ed8e20a4a660987127ea53077656c7a43f723 (patch) | |
tree | c5ceca0387a2f623b7704fa954825a57d8c8f4cc /winsup/cygwin | |
parent | 4a4f863459f083ed2d414b7ff1ca4fdc8ac36878 (diff) |
* fhandler.cc (fhandler_base::wait_overlapped): Reorganize again to accommodate
what appears to be an MSDN hint about not resetting the overlapped event prior
to calling GetOverlappedResult.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3d813be89..25a56e8bc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2008-08-21 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Reorganize again to + accommodate what appears to be an MSDN hint about not resetting the + overlapped event prior to calling GetOverlappedResult. + 2008-08-20 Corinna Vinschen <corinna@vinschen.de> * path.cc (symlink_info::check_shortcut): If file can't be opened, diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 1db40ac76..49af86f9e 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1691,6 +1691,7 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes) goto err; res = 1; *bytes = 0; + err = 0; } else { @@ -1707,7 +1708,7 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes) w4[n++] = signal_arrived; HANDLE h = writing ? get_output_handle () : get_handle (); DWORD res = WaitForMultipleObjects (n, w4, false, INFINITE); - ResetEvent (get_overlapped ()->hEvent); + err = 0; switch (res) { case WAIT_OBJECT_0: @@ -1738,9 +1739,10 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes) err: __seterrno_from_win_error (err); res = -1; +out: + ResetEvent (get_overlapped ()->hEvent); if (writing && (err == ERROR_NO_DATA || err == ERROR_BROKEN_PIPE)) raise (SIGPIPE); -out: return res; } |