Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-09-27 02:24:09 +0400
committerChristopher Faylor <me@cgf.cx>2001-09-27 02:24:09 +0400
commit5fe74396e949b601e54ddb00fa7e486d1be18013 (patch)
treeb0f3934a0fa68caa0fea6559a7c014fc9d068929 /winsup/cygwin/select.cc
parentc918cf9421b0888e60990f411718fe36b67875c9 (diff)
* select.cc (peek_pipe): REALLY only grab mutex when we actually got something
from the pipe.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc3
1 files changed, 2 insertions, 1 deletions
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);