+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.
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)
{
}
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);
}
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;
}
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;