* exceptions.cc (signal_exit): Move captive process termintation...

(_cygtls::interrupt_setup): ...into here.
(sigpacket::process): Simplify setting of handler when have_execed.
(_cygtls::interrupt_setup): Don't call proc_subproc when we've execed.
* globals.cc (exit_states): Delete unneeded ES_EXEC_EXIT.
* pinfo.cc (pinfo::exit): Change debugging output.  Call proc_terminate rather
than the now-obsolete sigproc_terminate.  Don't set exit_state to ES_EXEC_EXIT.
Set exit_state to ES_FINAL later.
* sigproc.cc (sigproc_terminate): Delete function.
(wait_sig): Don't call proc_subproc if have_execed.
* sigproc.h (sigproc_terminate): Delete declaration.
* sync.h (lock_process::lock_process): Don't set exit_state to
ES_PROCESS_LOCKED.
(lock_process::operator LONG): Define.
This commit is contained in:
Christopher Faylor
2013-01-14 06:03:59 +00:00
parent cdc1925e02
commit b712b4408a
7 changed files with 31 additions and 38 deletions

View File

@ -764,7 +764,8 @@ _cygtls::interrupt_setup (siginfo_t& si, void *handler, struct sigaction& siga)
if (incyg)
SetEvent (get_signal_arrived (false));
proc_subproc (PROC_CLEARWAIT, 1);
if (!have_execed)
proc_subproc (PROC_CLEARWAIT, 1);
sigproc_printf ("armed signal_arrived %p, signal %d", signal_arrived, si.si_signo);
}
@ -1089,12 +1090,6 @@ signal_exit (int sig, siginfo_t *si)
debug_printf ("exiting due to signal %d", sig);
exit_state = ES_SIGNAL_EXIT;
if (have_execed)
{
sigproc_printf ("terminating captive process");
TerminateProcess (ch_spawn, sigExeced = sig);
}
if (cygheap->rlim_core > 0UL)
switch (sig)
{
@ -1186,9 +1181,7 @@ sigpacket::process ()
sigproc_printf ("using tls %p", tls);
}
void *handler = (void *) thissig.sa_handler;
if (have_execed)
handler = NULL;
void *handler = have_execed ? NULL : (void *) thissig.sa_handler;
if (handler == SIG_IGN)
{
@ -1271,6 +1264,11 @@ dispatch_sig:
if we hit an exception. */
_my_tls.signal_debugger (si.si_signo);
}
if (have_execed)
{
sigproc_printf ("terminating captive process");
TerminateProcess (ch_spawn, sigExeced = si.si_signo);
}
/* Dispatch to the appropriate function. */
sigproc_printf ("signal %d, signal handler %p", si.si_signo, handler);
rc = setup_handler (handler, thissig, tls);