From 5406af205420544ded6c64206b4d87972108cb5b Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 19 Nov 2017 16:51:33 +0100 Subject: [PATCH] watchdog: Adjust WDT timeout (30 sec), use half that as kick period Signed-off-by: Joachim Nilsson --- src/watchdog.c | 6 +++--- src/watchdog.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/watchdog.c b/src/watchdog.c index 756013c0..e7f070e7 100644 --- a/src/watchdog.c +++ b/src/watchdog.c @@ -56,13 +56,13 @@ static int init(char *progname, char *devnode, int timeout) return fd; } -static int loop(int fd) +static int loop(int fd, int period) { int dummy = 0; while (running) { - do_sleep(1); ioctl(fd, WDIOC_KEEPALIVE, &dummy); + sleep(period); } if (handover) { @@ -87,7 +87,7 @@ int watchdog(char *progname) _exit(1); } - ret = loop(fd); + ret = loop(fd, WDT_TIMEOUT / 2); close(fd); _exit(ret); diff --git a/src/watchdog.h b/src/watchdog.h index 3baaca5c..61bf932b 100644 --- a/src/watchdog.h +++ b/src/watchdog.h @@ -24,7 +24,7 @@ #include "config.h" /* Generated by configure script */ #define WDT_DEVNODE "/dev/watchdog" -#define WDT_TIMEOUT 3 +#define WDT_TIMEOUT 30 #ifdef BUILTIN_WATCHDOG int watchdog(char *progname);