public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: FIFO: set client handler flags more accurately
@ 2019-05-09 18:52 Ken Brown
0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-05-09 18:52 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7ad80b3c233c96218985e603cfcb8051e1771505
commit 7ad80b3c233c96218985e603cfcb8051e1771505
Author: Ken Brown <kbrown@cornell.edu>
Date: Thu May 9 12:04:14 2019 -0400
Cygwin: FIFO: set client handler flags more accurately
Reflect the fact that client handlers are only used for reading and
that, after connection, they are always nonblocking.
Diff:
---
winsup/cygwin/fhandler_fifo.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 0d4a8b8..1b1b3c7 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -246,7 +246,8 @@ fhandler_fifo::add_client_handler ()
else
{
fh->set_handle (ph);
- fh->set_flags (get_flags ());
+ fh->set_flags ((openflags & ~O_ACCMODE) | O_RDONLY);
+ fh->set_nonblocking (false);
ret = 0;
fc.fh = fh;
fc_handler[nhandlers++] = fc;
@@ -298,6 +299,7 @@ fhandler_fifo::record_connection (fifo_client_handler& fc)
fifo_client_lock ();
fc.state = fc_connected;
nconnected++;
+ fc.fh->set_nonblocking (true);
set_pipe_non_blocking (fc.fh->get_handle (), true);
fifo_client_unlock ();
HANDLE evt = InterlockedExchangePointer (&fc.connect_evt, NULL);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-09 18:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 18:52 [newlib-cygwin] Cygwin: FIFO: set client handler flags more accurately 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).