mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-01 05:22:25 +07:00
uev_timer_set(): Check return value of timerfd API
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user