diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-04-07 13:44:32 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-04-07 13:44:36 +0200 |
commit | b9fcb589a4c086d786891f13dfececcfabc0c91f (patch) | |
tree | 5aecce53216349920314dada47e23e2dba3c870c /watchdog.c | |
parent | 5c6859ddf9f0ca57e297d2d178504c5ad1c063e7 (diff) | |
download | procd-b9fcb589a4c086d786891f13dfececcfabc0c91f.tar.gz |
watchdog: add support for starting/stopping watchdog refresh
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'watchdog.c')
-rw-r--r-- | watchdog.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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) |