mirror of
https://github.com/nasa/trick.git
synced 2025-01-31 00:24:03 +00:00
* disable sigchld handler by default #931 * update test to set sigchld trap before testing closes #931
This commit is contained in:
parent
b260bcb85f
commit
167c4a6530
@ -175,12 +175,12 @@ int Trick::Executive::init_signal_handlers() {
|
|||||||
|
|
||||||
static struct sigaction sigact;
|
static struct sigaction sigact;
|
||||||
|
|
||||||
/* By default catch SIGBUS, SIGSEGV, SIGABRT, and SIGCHLD. Don't catch SIGFPE */
|
/* By default catch SIGBUS, SIGSEGV, SIGABRT. Don't catch SIGFPE, SIGCHLD */
|
||||||
set_trap_sigbus(true) ;
|
set_trap_sigbus(true) ;
|
||||||
set_trap_sigfpe(false) ;
|
set_trap_sigfpe(false) ;
|
||||||
set_trap_sigsegv(true) ;
|
set_trap_sigsegv(true) ;
|
||||||
set_trap_sigabrt(true) ;
|
set_trap_sigabrt(true) ;
|
||||||
set_trap_sigchld(true) ;
|
set_trap_sigchld(false) ;
|
||||||
|
|
||||||
/* Assign ctrl_c_hand() as the default signal handler for SIGINT (<CTRL-C> keypress). */
|
/* Assign ctrl_c_hand() as the default signal handler for SIGINT (<CTRL-C> keypress). */
|
||||||
sigact.sa_handler = (void (*)(int)) ctrl_c_hand;
|
sigact.sa_handler = (void (*)(int)) ctrl_c_hand;
|
||||||
|
@ -796,18 +796,19 @@ TEST_F(ExecutiveTest , SetSignalHandlers) {
|
|||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
sigaction(SIGSEGV, NULL , &sigact) ;
|
sigaction(SIGSEGV, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
sigaction(SIGCHLD, NULL , &sigact) ;
|
|
||||||
EXPECT_TRUE( sigact.sa_handler == child_handler ) ;
|
|
||||||
sigaction(SIGFPE, NULL , &sigact) ;
|
sigaction(SIGFPE, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == SIG_DFL ) ;
|
EXPECT_TRUE( sigact.sa_handler == SIG_DFL ) ;
|
||||||
|
|
||||||
exec.set_trap_sigbus(1) ;
|
exec.set_trap_sigbus(1) ;
|
||||||
exec.set_trap_sigsegv(1) ;
|
exec.set_trap_sigsegv(1) ;
|
||||||
exec.set_trap_sigfpe(1) ;
|
exec.set_trap_sigfpe(1) ;
|
||||||
|
exec.set_trap_sigchld(1) ;
|
||||||
sigaction(SIGBUS, NULL , &sigact) ;
|
sigaction(SIGBUS, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
sigaction(SIGSEGV, NULL , &sigact) ;
|
sigaction(SIGSEGV, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
|
sigaction(SIGCHLD, NULL , &sigact) ;
|
||||||
|
EXPECT_TRUE( sigact.sa_handler == child_handler ) ;
|
||||||
sigaction(SIGFPE, NULL , &sigact) ;
|
sigaction(SIGFPE, NULL , &sigact) ;
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
EXPECT_TRUE( sigact.sa_handler == fpe_sig_handler ) ;
|
EXPECT_TRUE( sigact.sa_handler == fpe_sig_handler ) ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user