diff options
author | Christopher Faylor <me@cgf.cx> | 2004-12-06 00:29:41 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-12-06 00:29:41 +0000 |
commit | 8c43a9f82e078662b70a1777f232edd7b37dfa02 (patch) | |
tree | 3b291a9542f6cf4ab3b13c76f0777e3023e7f4be /winsup/cygwin/sigproc.cc | |
parent | 013f043fff95d2f456f97b81cd3bd4ee02000cc0 (diff) | |
download | cygnal-8c43a9f82e078662b70a1777f232edd7b37dfa02.tar.gz cygnal-8c43a9f82e078662b70a1777f232edd7b37dfa02.tar.bz2 cygnal-8c43a9f82e078662b70a1777f232edd7b37dfa02.zip |
* fork.cc (fork_parent): Reinstate "childhProc" protection. Don't close
hProcess handle here since it is used to ensure that a new process isn't
created with the old pid after the old pid exits.
* spawn.cc (spawn_guts): Ditto.
* pinfo.cc (proc_waiter): Don't send any signals if we've execed since this
process doesn't officially exist.
* pinfo.h (pinfo::pid_handle): Eliminate. Just use hProc.
* sigproc.cc (sig_send): Don't send any signals if our sendsig doesn't exist.
That's a sign that we are execing.
(remove_proc): Eliminate pid_handle close.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index bc1d6fff6..7b3ba89ad 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -82,6 +82,8 @@ static bool __stdcall remove_proc (int); static bool __stdcall stopped_or_terminated (waitq *, _pinfo *); static DWORD WINAPI wait_sig (VOID *arg); +extern HANDLE hExeced; + /* wait_sig bookkeeping */ class pending_signals @@ -501,7 +503,6 @@ sigproc_init () void __stdcall sigproc_terminate (void) { - extern HANDLE hExeced; hwait_sig = NULL; if (myself->sendsig == INVALID_HANDLE_VALUE) @@ -509,7 +510,6 @@ sigproc_terminate (void) else { sigproc_printf ("entering"); - // finished with anything it is doing if (!hExeced) { HANDLE sendsig = myself->sendsig; @@ -545,6 +545,9 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls) sigpacket pack; pack.wakeup = NULL; + if (!myself->sendsig) // FIXME: This catches the exec case but what if the exec is going to fail? + goto out; + bool wait_for_completion; if (!(its_me = (p == NULL || p == myself || p == myself_nowait))) wait_for_completion = false; @@ -657,7 +660,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls) { if (no_signals_available ()) sigproc_printf ("I'm going away now"); - else + else if (!hExeced) system_printf ("error sending signal %d to pid %d, pipe handle %p, %E", si.si_signo, p->pid, sendsig); } @@ -857,8 +860,6 @@ remove_proc (int ci) if (procs[ci] != myself) { procs[ci].release (); - if (procs[ci].pid_handle) - ForceCloseHandle1 (procs[ci].pid_handle, childhProc); if (procs[ci].hProcess) ForceCloseHandle1 (procs[ci].hProcess, childhProc); } |