diff options
author | Christopher Faylor <me@cgf.cx> | 2011-05-05 15:03:54 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-05-05 15:03:54 +0000 |
commit | b8424c5e9a7aaa08ece65fd1e67deeb4437050cf (patch) | |
tree | ff94cbf60cb5b41c18c8c0444ae5f1dd8f83eac1 /winsup/cygwin | |
parent | 1395dac1d021fa42b0a5de32de91a076d1e6d58a (diff) | |
download | cygnal-b8424c5e9a7aaa08ece65fd1e67deeb4437050cf.tar.gz cygnal-b8424c5e9a7aaa08ece65fd1e67deeb4437050cf.tar.bz2 cygnal-b8424c5e9a7aaa08ece65fd1e67deeb4437050cf.zip |
* fork.cc (fork): Clear PID_REAPED.
* pinfo.cc (pinfo_init): Ditto.
(pinfo::init): Check for PID_REAPED.
* sigproc.cc (stopped_or_terminated): Ditto.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/fork.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/pinfo.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.cc | 2 |
4 files changed, 12 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f0d06d1bc..b3c051ca0 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 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. 2011-05-05 Corinna Vinschen <corinna@vinschen.de> diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 5a70c7b87..790976b34 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -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) { diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 4d7bc158d..2096475a9 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -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; } diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 43655dc4c..8a6559f55 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -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; |