From: Michael Stapelberg Date: Sun, 3 Jan 2010 20:55:22 +0000 (+0100) Subject: Check return code of sigaction() X-Git-Tag: 3.e~6^2~169 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=be33c8e599cab989be9b2041106625aa7eacef96;p=i3%2Fi3 Check return code of sigaction() --- diff --git a/src/sighandler.c b/src/sighandler.c index 8bfec493..dc551ffc 100644 --- a/src/sighandler.c +++ b/src/sighandler.c @@ -205,6 +205,8 @@ void setup_signal_handler() { action.sa_sigaction = handle_signal; action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; 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"); }