]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: FIFO: set client handler flags more accurately
authorKen Brown <kbrown@cornell.edu>
Thu, 9 May 2019 16:04:14 +0000 (12:04 -0400)
committerKen Brown <kbrown@cornell.edu>
Thu, 9 May 2019 18:41:29 +0000 (14:41 -0400)
Reflect the fact that client handlers are only used for reading and
that, after connection, they are always nonblocking.

winsup/cygwin/fhandler_fifo.cc

index 0d4a8b8ee75d51f4fe507c8a5b18c0fd6568b02c..1b1b3c7ebfbae591e3cf500a9212d356833e2940 100644 (file)
@@ -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);
This page took 0.03525 seconds and 5 git commands to generate.