* fork.cc (fork): Clear PID_REAPED.
* pinfo.cc (pinfo_init): Ditto. (pinfo::init): Check for PID_REAPED. * sigproc.cc (stopped_or_terminated): Ditto.
This commit is contained in:
parent
1395dac1d0
commit
b8424c5e9a
@ -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>
|
2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx>
|
||||||
|
|
||||||
* pinfo.cc (_pinfo::exists): Check for PID_REAPED.
|
* pinfo.cc (_pinfo::exists): Check for PID_REAPED.
|
||||||
|
@ -621,7 +621,7 @@ fork ()
|
|||||||
if (ischild)
|
if (ischild)
|
||||||
{
|
{
|
||||||
myself->process_state |= PID_ACTIVE;
|
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)
|
else if (res < 0)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,7 @@ pinfo_init (char **envp, int envc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
myself->process_state |= PID_ACTIVE;
|
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);
|
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
|
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
|
only be a brief occurrence, so rather than introduce some kind of
|
||||||
locking mechanism, just loop. */
|
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, "
|
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);
|
n, procinfo->pid, procinfo->dwProcessId);
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
@ -1022,7 +1022,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
|
|||||||
|
|
||||||
int terminated;
|
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 & WCONTINUED) && child->stopsig == SIGCONT)
|
||||||
|| ((w->options & WUNTRACED) && child->stopsig && child->stopsig != SIGCONT)))
|
|| ((w->options & WUNTRACED) && child->stopsig && child->stopsig != SIGCONT)))
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user