Catch errors from timerfd_settime
authorBen Gamari <ben@smart-cactus.org>
Thu, 21 Apr 2016 11:57:18 +0000 (13:57 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sun, 1 May 2016 21:29:49 +0000 (23:29 +0200)
rts/posix/itimer/Pthread.c

index e84a53a..2133a5b 100644 (file)
@@ -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) {