]> git.sur5r.net Git - i3/i3/commitdiff
Check return code of sigaction()
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 3 Jan 2010 20:55:22 +0000 (21:55 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 3 Jan 2010 20:55:22 +0000 (21:55 +0100)
src/sighandler.c

index 8bfec4933d450c0b8f37cad371f7ef56b9f9ce1c..dc551ffc646bdb1d85e003ea90a22bb0238a22a8 100644 (file)
@@ -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");
 }