diff options
author | Christopher Faylor <me@cgf.cx> | 2009-06-28 19:27:15 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2009-06-28 19:27:15 +0000 |
commit | 7fc7ee1726dbe3e443266c669b23a816e87fd85d (patch) | |
tree | 80a3b4455914d6aa02763690c72ba3906ff8a6b6 | |
parent | c81ceaefec39454f5f76f91be2885d577a668527 (diff) | |
download | cygnal-7fc7ee1726dbe3e443266c669b23a816e87fd85d.tar.gz cygnal-7fc7ee1726dbe3e443266c669b23a816e87fd85d.tar.bz2 cygnal-7fc7ee1726dbe3e443266c669b23a816e87fd85d.zip |
* select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe is ready
for writing rather than performing brute-force checks.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/select.cc | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 24a66bef0..2fdb5b2c1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 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. * 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 26cb3b40e..e9dac26ce 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 { |