SCP: Ignore subsequent SIGTERM receipt after initial receipt.
The OS may signal SIGTERM more than once before ultimately issuing a SIGKILL. The initial SIGTERM will stop execution and initiate optional simulator cleanup. Ignoring follow up SIGTERMs will allow as much cleanup as possible to be achieved and thus allow the simulator to complete its cleanup and exit or ultimately exit die due to receipt of SIGKILL. Likewise for SIGHUP on hosts that can issue SIGHUP.
This commit is contained in:
parent
eaa6944551
commit
2a75aa630c
1 changed files with 2 additions and 2 deletions
4
scp.c
4
scp.c
|
@ -8640,9 +8640,9 @@ sim_stop_timer_services (); /* disable wall clock ti
|
|||
sim_ttcmd (); /* restore console */
|
||||
sim_brk_clrall (BRK_TYP_DYN_STEPOVER); /* cancel any step/over subroutine breakpoints */
|
||||
#ifdef SIGHUP
|
||||
signal (SIGHUP, SIG_DFL); /* cancel WRU */
|
||||
signal (SIGHUP, sigterm_received ? SIG_IGN : SIG_DFL); /* cancel WRU */
|
||||
#endif
|
||||
signal (SIGTERM, SIG_DFL); /* cancel WRU */
|
||||
signal (SIGTERM, sigterm_received ? SIG_IGN : SIG_DFL); /* cancel WRU */
|
||||
sim_flush_buffered_files();
|
||||
sim_cancel (&sim_flush_unit); /* cancel flush timer */
|
||||
sim_cancel_step (); /* cancel step timer */
|
||||
|
|
Loading…
Add table
Reference in a new issue