summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2009-06-30 14:36:11 +0000
committerChristopher Faylor <me@cgf.cx>2009-06-30 14:36:11 +0000
commit840bb397986fa6914a67e62e25df97e1dd88dc45 (patch)
tree82e77a17cc59eb72e542e6b36192e69a31b24916 /winsup/cygwin/fhandler.cc
parent4a83803381f3ce1838f5650e7096d9006f673fdd (diff)
downloadcygnal-840bb397986fa6914a67e62e25df97e1dd88dc45.tar.gz
cygnal-840bb397986fa6914a67e62e25df97e1dd88dc45.tar.bz2
cygnal-840bb397986fa6914a67e62e25df97e1dd88dc45.zip
* fhandler.cc (fhandler_base::has_ongoing_io): Accept an argument indicating
whether the overlapped event should be tested. (fhandler_base::read_overlapped): Pass is_overlapped state to has_ongoing_io. (fhandler_base::write_overlapped): Ditto. * fhandler.h (fhandler_base::has_ongoing_io): Accommodate argument change. * select.cc (peek_pipe): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 650cca9e9..0488374c6 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1764,9 +1764,9 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes, DWORD le
}
bool __stdcall
-fhandler_base::has_ongoing_io ()
+fhandler_base::has_ongoing_io (bool testit)
{
- if (get_overlapped () && get_overlapped ()->hEvent
+ if (testit && get_overlapped () && get_overlapped ()->hEvent
&& WaitForSingleObject (get_overlapped ()->hEvent, 0) != WAIT_OBJECT_0)
{
set_errno (EAGAIN);
@@ -1781,7 +1781,7 @@ fhandler_base::read_overlapped (void *ptr, size_t& len)
DWORD nbytes;
while (1)
{
- if (has_ongoing_io ())
+ if (has_ongoing_io (is_nonblocking ()))
{
nbytes = (DWORD) -1;
break;
@@ -1801,7 +1801,7 @@ fhandler_base::write_overlapped (const void *ptr, size_t len)
DWORD nbytes;
while (1)
{
- if (has_ongoing_io ())
+ if (has_ongoing_io (is_nonblocking ()))
{
nbytes = (DWORD) -1;
break;