[commit: ghc] master: Catch errors from timerfd_settime (df9b772)

git at git.haskell.org git at git.haskell.org
Sun May 1 21:56:00 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/df9b772a40d7cbbad260f29211fe6cd0bb119908/ghc

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

commit df9b772a40d7cbbad260f29211fe6cd0bb119908
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Apr 21 13:57:18 2016 +0200

    Catch errors from timerfd_settime


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

df9b772a40d7cbbad260f29211fe6cd0bb119908
 rts/posix/itimer/Pthread.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c
index e84a53a..2133a5b4 100644
--- a/rts/posix/itimer/Pthread.c
+++ b/rts/posix/itimer/Pthread.c
@@ -105,7 +105,10 @@ static void *itimer_thread_func(void *_handle_tick)
     if (!TFD_CLOEXEC) {
       fcntl(timerfd, F_SETFD, FD_CLOEXEC);
     }
-    int ret = timerfd_settime(timerfd, 0, &it, NULL);
+    if (timerfd_settime(timerfd, 0, &it, NULL)) {
+        sysErrorBelch("timerfd_settime");
+        stg_exit(EXIT_FAILURE);
+    }
 #endif
 
     while (1) {



More information about the ghc-commits mailing list