* select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe is ready

for writing rather than performing brute-force checks.
This commit is contained in:
Christopher Faylor 2009-06-28 19:27:15 +00:00
parent c81ceaefec
commit 7fc7ee1726
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
* select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe
is ready for writing rather than performing brute-force checks.
2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.h (fhandler_base::has_ongoing_io): Declare new function.

View File

@ -513,9 +513,7 @@ out:
else if (fh->get_device () == FH_PIPER)
select_printf ("%s, select for write on read end of pipe",
fh->get_name ());
else if (fh->get_overlapped () && fh->get_overlapped ()->hEvent
&& WaitForSingleObject (fh->get_overlapped ()->hEvent, 0)
!= WAIT_OBJECT_0)
else if (fh->has_ongoing_io ())
s->write_ready = false;
else
{