Check return value of sigaction
authorNicolas Trangez <ikke@nicolast.be>
Wed, 23 Apr 2014 18:06:15 +0000 (20:06 +0200)
committerAustin Seipp <austin@well-typed.com>
Sun, 27 Apr 2014 09:21:01 +0000 (04:21 -0500)
Issue discovered by Coverity scan, CID 43142.

Signed-off-by: Austin Seipp <austin@well-typed.com>
rts/posix/Signals.c

index 01d5347..f4a8341 100644 (file)
@@ -574,7 +574,9 @@ set_sigtstp_action (rtsBool handle)
     }
     sa.sa_flags = 0;
     sigemptyset(&sa.sa_mask);
-    sigaction(SIGTSTP, &sa, NULL);
+    if (sigaction(SIGTSTP, &sa, NULL) != 0) {
+        sysErrorBelch("warning: failed to install SIGTSTP handler");
+    }
 }
 
 /* -----------------------------------------------------------------------------