X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=watchdog.c;fp=watchdog.c;h=2a516b4c5e0271489cd4f0f79763165e71aafb44;hp=0ba8f25f0ea1423f6e897aecff384e3735cbf381;hb=b9fcb589a4c086d786891f13dfececcfabc0c91f;hpb=5c6859ddf9f0ca57e297d2d178504c5ad1c063e7 diff --git a/watchdog.c b/watchdog.c index 0ba8f25..2a516b4 100644 --- a/watchdog.c +++ b/watchdog.c @@ -40,6 +40,19 @@ static void watchdog_timeout_cb(struct uloop_timeout *t) uloop_timeout_set(t, wdt_frequency * 1000); } +void watchdog_set_stopped(bool val) +{ + if (val) + uloop_timeout_cancel(&wdt_timeout); + else + watchdog_timeout_cb(&wdt_timeout); +} + +bool watchdog_get_stopped(void) +{ + return !wdt_timeout.pending; +} + int watchdog_timeout(int timeout) { if (wdt_fd < 0)