summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2019-05-09 12:04:14 -0400
committerKen Brown <kbrown@cornell.edu>2019-05-09 14:41:29 -0400
commit7ad80b3c233c96218985e603cfcb8051e1771505 (patch)
tree56ad90ac1ac8b40b904be70b7b3952017511680e
parentc12053a793246742f7c7a177b9e7656c602c52d2 (diff)
downloadcygnal-7ad80b3c233c96218985e603cfcb8051e1771505.tar.gz
cygnal-7ad80b3c233c96218985e603cfcb8051e1771505.tar.bz2
cygnal-7ad80b3c233c96218985e603cfcb8051e1771505.zip
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.
-rw-r--r--winsup/cygwin/fhandler_fifo.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 0d4a8b8ee..1b1b3c7eb 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);