[commit: ghc] ghc-7.8: Check return value of sigaction (2439da0)

git at git.haskell.org git at git.haskell.org
Sun Apr 27 14:44:20 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/2439da08fb3525f94d340132dc698c36a102ab28/ghc

>---------------------------------------------------------------

commit 2439da08fb3525f94d340132dc698c36a102ab28
Author: Nicolas Trangez <ikke at nicolast.be>
Date:   Wed Apr 23 20:06:15 2014 +0200

    Check return value of sigaction
    
    Issue discovered by Coverity scan, CID 43142.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>
    (cherry picked from commit f2595fd9d03803874df792072292d792a2c03bce)


>---------------------------------------------------------------

2439da08fb3525f94d340132dc698c36a102ab28
 rts/posix/Signals.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c
index 01d5347..f4a8341 100644
--- a/rts/posix/Signals.c
+++ b/rts/posix/Signals.c
@@ -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");
+    }
 }
 
 /* -----------------------------------------------------------------------------



More information about the ghc-commits mailing list