diff options
author | Christopher Faylor <me@cgf.cx> | 2001-09-26 22:24:09 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-09-26 22:24:09 +0000 |
commit | 5fe74396e949b601e54ddb00fa7e486d1be18013 (patch) | |
tree | b0f3934a0fa68caa0fea6559a7c014fc9d068929 | |
parent | c918cf9421b0888e60990f411718fe36b67875c9 (diff) | |
download | cygnal-5fe74396e949b601e54ddb00fa7e486d1be18013.tar.gz cygnal-5fe74396e949b601e54ddb00fa7e486d1be18013.tar.bz2 cygnal-5fe74396e949b601e54ddb00fa7e486d1be18013.zip |
* select.cc (peek_pipe): REALLY only grab mutex when we actually got something
from the pipe.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/select.cc | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 708462f73..e14725dc6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 26 16:02:35 2001 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): REALLY only grab mutex when we actually got + something from the pipe. + Tue Sep 25 21:25:00 2001 Robert Collins <rbtcollins@hotmail.com> * thread.cc (pthread_cond::BroadCast): Use address with verifyable_object_isvalid(). diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index bef4e8ac0..2307e297e 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -454,7 +454,8 @@ peek_pipe (select_record *s, int ignra, HANDLE guard_mutex = NULL) select_printf ("%s, PeekNamedPipe failed, %E", fh->get_name ()); n = -1; } - else if (guard_mutex && WaitForSingleObject (guard_mutex, 0) != WAIT_OBJECT_0) + else if (n && guard_mutex + && WaitForSingleObject (guard_mutex, 0) != WAIT_OBJECT_0) { select_printf ("%s, couldn't get mutex %p, %E", fh->get_name (), guard_mutex); |