]> sourceware.org Git - newlib-cygwin.git/commitdiff
* pinfo.cc (pinfo::wait): Handle case where prefork was not called prior to
authorChristopher Faylor <me@cgf.cx>
Mon, 19 Mar 2012 16:51:30 +0000 (16:51 +0000)
committerChristopher Faylor <me@cgf.cx>
Mon, 19 Mar 2012 16:51:30 +0000 (16:51 +0000)
calling wait().  This is the case when we are reabsorbing processes after being
execed.

winsup/cygwin/ChangeLog
winsup/cygwin/pinfo.cc

index ebcf00afd3dedc95ab6c46f83daed2927f356afd..3c25957d16d810cd87a846109df003c9c5ef55de 100644 (file)
@@ -1,3 +1,9 @@
+2012-03-19  Christopher Faylor  <me.cygwin2012@cgf.cx>
+
+       * pinfo.cc (pinfo::wait): Handle case where prefork was not called
+       prior to calling wait().  This is the case when we are reabsorbing
+       processes after being execed.
+
 2012-03-16  Christopher Faylor  <me.cygwin2012@cgf.cx>
 
        * fork.cc (lock_signals): Move to sigproc.h.
index c5e6464552d8fa7b33a372d26b6faca9418dc9cd..bc0de4735e442e15a2fce4a6c23d07f526eebd65 100644 (file)
@@ -987,12 +987,15 @@ proc_waiter (void *arg)
 bool
 pinfo::wait ()
 {
-  rd_proc_pipe = pending_rd_proc_pipe;
-  pending_rd_proc_pipe = NULL;
+  if (pending_rd_proc_pipe)
+    {
+      rd_proc_pipe = pending_rd_proc_pipe;
+      pending_rd_proc_pipe = NULL;
 
-  wr_proc_pipe () = pending_wr_proc_pipe;
-  ForceCloseHandle1 (pending_wr_proc_pipe, wr_proc_pipe);
-  pending_wr_proc_pipe = NULL;
+      wr_proc_pipe () = pending_wr_proc_pipe;
+      ForceCloseHandle1 (pending_wr_proc_pipe, wr_proc_pipe);
+      pending_wr_proc_pipe = NULL;
+    }
 
   preserve ();         /* Preserve the shared memory associated with the pinfo */
 
This page took 0.034522 seconds and 5 git commands to generate.