summaryrefslogtreecommitdiffstats
path: root/watchdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'watchdog.c')
-rw-r--r--watchdog.c13
1 files changed, 13 insertions, 0 deletions
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)