Check return code of sigaction()

This commit is contained in:
Michael Stapelberg 2010-01-03 21:55:22 +01:00
parent a69dfb3f06
commit be33c8e599
1 changed files with 4 additions and 2 deletions

View File

@ -205,6 +205,8 @@ void setup_signal_handler() {
action.sa_sigaction = handle_signal; action.sa_sigaction = handle_signal;
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
sigemptyset(&action.sa_mask); sigemptyset(&action.sa_mask);
sigaction(SIGSEGV, &action, NULL);
sigaction(SIGFPE, &action, NULL); if (sigaction(SIGSEGV, &action, NULL) == -1 ||
sigaction(SIGFPE, &action, NULL) == -1)
ELOG("Could not setup signal handler");
} }