summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2019-06-19 11:14:37 -0400
committerKen Brown <kbrown@cornell.edu>2019-06-23 10:16:34 -0400
commit23570916173c9f16213f1a524ddc96878b4c9d80 (patch)
tree262fc92eab9326f0ccf8baefed38bcdf82cbfe54
parent6e7e82fee758695c3e46618038325d41e44fbef5 (diff)
downloadcygnal-23570916173c9f16213f1a524ddc96878b4c9d80.tar.gz
cygnal-23570916173c9f16213f1a524ddc96878b4c9d80.tar.bz2
cygnal-23570916173c9f16213f1a524ddc96878b4c9d80.zip
Cygwin: FIFO: slightly change the use of write_ready
Make it a manual reset event. It's only used once to allow a reader to open, and there's no reason to ever reset it. Defensively set it when a client connection is recorded, even though it should be set by the writer that connected.
-rw-r--r--winsup/cygwin/fhandler_fifo.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index a060cb3fc..e0af54b2e 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -298,6 +298,7 @@ fhandler_fifo::listen_client ()
void
fhandler_fifo::record_connection (fifo_client_handler& fc)
{
+ SetEvent (write_ready);
fc.state = fc_connected;
nconnected++;
fc.fh->set_nonblocking (true);
@@ -489,7 +490,7 @@ fhandler_fifo::open (int flags, mode_t)
goto out;
}
npbuf[0] = 'w';
- if (!(write_ready = CreateEvent (sa_buf, false, false, npbuf)))
+ if (!(write_ready = CreateEvent (sa_buf, true, false, npbuf)))
{
debug_printf ("CreateEvent for %s failed, %E", npbuf);
res = error_set_errno;