From fef83a738d75a58c490b705c43fcca58d6dec2c3 Mon Sep 17 00:00:00 2001 From: cgf Date: Sun, 28 Jun 2009 19:27:14 +0000 Subject: [PATCH] * select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe is ready for writing rather than performing brute-force checks. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/select.cc | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 24a66bef0f..2fdb5b2c14 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2009-06-28 Christopher Faylor + * 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 + * fhandler.h (fhandler_base::has_ongoing_io): Declare new function. * fhandler.cc (fhandler_base::has_ongoing_io): Define new function. (fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 26cb3b40ef..e9dac26ce1 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -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 { -- 2.11.0