diff options
author | John Crispin <blogic@openwrt.org> | 2014-11-01 23:23:47 +0100 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-11-05 16:23:20 +0100 |
commit | 9286d16672b26c9fe7cb9dbf827a43a910df5559 (patch) | |
tree | 49cf3334120735144d972f71d257a75c1cc1ecd1 /watchdog.c | |
parent | 6f52ef3cc9f01e952e7f32d10c7f8612e635e80c (diff) | |
download | unitd-9286d16672b26c9fe7cb9dbf827a43a910df5559.tar unitd-9286d16672b26c9fe7cb9dbf827a43a910df5559.zip |
kmodloader takes longer than wdt timeout
on systms with slow flash the watchdog will trigger when a lot of modules are
included in the image.
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'watchdog.c')
-rw-r--r-- | watchdog.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -32,11 +32,16 @@ static struct uloop_timeout wdt_timeout; static int wdt_fd = -1; static int wdt_frequency = 5; -static void watchdog_timeout_cb(struct uloop_timeout *t) +void watchdog_ping(void) { DEBUG(4, "Ping\n"); if (write(wdt_fd, "X", 1) < 0) ERROR("WDT failed to write: %s\n", strerror(errno)); +} + +static void watchdog_timeout_cb(struct uloop_timeout *t) +{ + watchdog_ping(); uloop_timeout_set(t, wdt_frequency * 1000); } |