1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00

sd-event: don't accidentally turn of watchdog timer event if we determine 0

This commit is contained in:
Lennart Poettering 2014-03-25 00:01:51 +01:00
parent 52444dc478
commit 7514578081
Notes: Lennart Poettering 2014-03-25 05:03:27 +01:00
Backport: bugfix

View File

@ -2087,6 +2087,11 @@ static int arm_watchdog(sd_event *e) {
timespec_store(&its.it_value, t);
/* Make sure we never set the watchdog to 0, which tells the
* kernel to disable it. */
if (its.it_value.tv_sec == 0 && its.it_value.tv_nsec == 0)
its.it_value.tv_nsec = 1;
r = timerfd_settime(e->watchdog_fd, TFD_TIMER_ABSTIME, &its, NULL);
if (r < 0)
return -errno;