From 52d8d7109bd5914297af96ff092968f662fb9352 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 30 Oct 2016 14:49:49 +0100 Subject: [PATCH] uev_timer_set(): Check return value of timerfd API Signed-off-by: Joachim Nilsson --- timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/timer.c b/timer.c index 012f3d4..c00788e 100644 --- a/timer.c +++ b/timer.c @@ -131,7 +131,8 @@ int uev_timer_set(uev_t *w, int timeout, int period) msec2tspec(timeout, &time.it_value); msec2tspec(period, &time.it_interval); - timerfd_settime(w->fd, 0, &time, NULL); + if (timerfd_settime(w->fd, 0, &time, NULL) < 0) + return 1; } return uev_watcher_start(w);