public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: FIFO: slightly change the use of write_ready
@ 2019-06-23 17:10 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-06-23 17:10 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=23570916173c9f16213f1a524ddc96878b4c9d80

commit 23570916173c9f16213f1a524ddc96878b4c9d80
Author: Ken Brown <kbrown@cornell.edu>
Date:   Wed Jun 19 11:14:37 2019 -0400

    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.

Diff:
---
 winsup/cygwin/fhandler_fifo.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index a060cb3..e0af54b 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-23 17:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-23 17:10 [newlib-cygwin] Cygwin: FIFO: slightly change the use of write_ready Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).