Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-12-06 03:29:41 +0300
committerChristopher Faylor <me@cgf.cx>2004-12-06 03:29:41 +0300
commit8c43a9f82e078662b70a1777f232edd7b37dfa02 (patch)
tree3b291a9542f6cf4ab3b13c76f0777e3023e7f4be /winsup/cygwin/sigproc.cc
parent013f043fff95d2f456f97b81cd3bd4ee02000cc0 (diff)
* 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.cc11
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);
}