* 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.
This commit is contained in:
Christopher Faylor 2008-08-22 04:06:01 +00:00
parent 4a4f863459
commit 8b2ed8e20a
2 changed files with 10 additions and 2 deletions

View file

@ -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,

View file

@ -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;
}