]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: FIFO: restart listen_client thread after fork/exec
authorKen Brown <kbrown@cornell.edu>
Sat, 20 Apr 2019 15:46:09 +0000 (11:46 -0400)
committerKen Brown <kbrown@cornell.edu>
Mon, 22 Apr 2019 11:55:58 +0000 (07:55 -0400)
This allows writers to connect immediately.  Previously the lct wasn't
restarted until the reader attempted to read.

winsup/cygwin/fhandler_fifo.cc

index 9b94a6da9dd792995c2ece1293000703ce3e5d5c..ac2196c92c3c58675420623267c57cc88ca74405 100644 (file)
@@ -755,7 +755,7 @@ fhandler_fifo::raw_read (void *in_ptr, size_t& len)
 {
   size_t orig_len = len;
 
-  /* Start the listen_client thread if necessary (e.g., after fork or exec). */
+  /* Start the listen_client thread if necessary (shouldn't be). */
   if (!listen_client_thr && !listen_client ())
     goto errout;
 
@@ -960,18 +960,16 @@ fhandler_fifo::fixup_after_fork (HANDLE parent)
       fc_handler[i].fh->fhandler_base::fixup_after_fork (parent);
       fork_fixup (parent, fc_handler[i].connect_evt, "connect_evt");
     }
-  listen_client_thr = NULL;
-  lct_termination_evt = NULL;
-  fifo_client_unlock ();
+  if (reader && !listen_client ())
+    debug_printf ("failed to start lct, %E");
 }
 
 void
 fhandler_fifo::fixup_after_exec ()
 {
   fhandler_base::fixup_after_exec ();
-  listen_client_thr = NULL;
-  lct_termination_evt = NULL;
-  fifo_client_unlock ();
+  if (reader && !listen_client ())
+    debug_printf ("failed to start lct, %E");
 }
 
 void
This page took 0.036854 seconds and 5 git commands to generate.