]> sourceware.org Git - newlib-cygwin.git/commitdiff
* fork.cc (fork): Clear PID_REAPED.
authorChristopher Faylor <me@cgf.cx>
Thu, 5 May 2011 15:03:54 +0000 (15:03 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 5 May 2011 15:03:54 +0000 (15:03 +0000)
* pinfo.cc (pinfo_init): Ditto.
(pinfo::init): Check for PID_REAPED.
* sigproc.cc (stopped_or_terminated): Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/fork.cc
winsup/cygwin/pinfo.cc
winsup/cygwin/sigproc.cc

index f0d06d1bc3524ea6bf8438dc6309da1a8bc22e5d..b3c051ca0e03852f522c82a05a1609b5c48e2a59 100644 (file)
@@ -1,3 +1,10 @@
+2011-05-05  Christopher Faylor  <me.cygwin2011@cgf.cx>
+
+       * fork.cc (fork): Clear PID_REAPED.
+       * pinfo.cc (pinfo_init): Ditto.
+       (pinfo::init): Check for PID_REAPED.
+       * sigproc.cc (stopped_or_terminated): Ditto.
+
 2011-05-05  Christopher Faylor  <me.cygwin2011@cgf.cx>
 
        * pinfo.cc (_pinfo::exists): Check for PID_REAPED.
index 5a70c7b87badbcc3245c5f3a172a979c9b1263d8..790976b34eaf4e82f849b36b2af2e9239b890859 100644 (file)
@@ -621,7 +621,7 @@ fork ()
   if (ischild)
     {
       myself->process_state |= PID_ACTIVE;
-      myself->process_state &= ~(PID_INITIALIZING | PID_EXITED);
+      myself->process_state &= ~(PID_INITIALIZING | PID_EXITED | PID_REAPED);
     }
   else if (res < 0)
     {
index 4d7bc158db418ddcff6eec0f8ccd2bbf3670d93b..2096475a94cad968bf0e363794e2e3a70b0566ec 100644 (file)
@@ -111,7 +111,7 @@ pinfo_init (char **envp, int envc)
     }
 
   myself->process_state |= PID_ACTIVE;
-  myself->process_state &= ~(PID_INITIALIZING | PID_EXITED);
+  myself->process_state &= ~(PID_INITIALIZING | PID_EXITED | PID_REAPED);
   debug_printf ("pid %d, pgid %d", myself->pid, myself->pgid);
 }
 
@@ -302,10 +302,10 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
         region to exist for a while after a process has exited.  This should
         only be a brief occurrence, so rather than introduce some kind of
         locking mechanism, just loop.  */
-      if (!created && createit && (procinfo->process_state & PID_EXITED))
+      if (!created && createit && (procinfo->process_state & (PID_EXITED | PID_REAPED)))
        {
          debug_printf ("looping because pid %d, procinfo->pid %d, "
-                       "procinfo->dwProcessid %u has PID_EXITED set",
+                       "procinfo->dwProcessid %u has PID_EXITED|PID_REAPED set",
                        n, procinfo->pid, procinfo->dwProcessId);
          goto loop;
        }
index 43655dc4c29a717f3be717c2b26e7fd846933583..8a6559f55a036eebfcdb5a5aa0f1de3397c2ca97 100644 (file)
@@ -1022,7 +1022,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
 
   int terminated;
 
-  if (!((terminated = (child->process_state == PID_EXITED))
+  if (!((terminated = (child->process_state & (PID_REAPED | PID_EXITED)))
        || ((w->options & WCONTINUED) && child->stopsig == SIGCONT)
        || ((w->options & WUNTRACED) && child->stopsig && child->stopsig != SIGCONT)))
     return false;
This page took 0.040063 seconds and 5 git commands to generate.