mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
watchdog: Adjust WDT timeout (30 sec), use half that as kick period
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
3c800f6508
commit
5406af2054
2 files changed
+4
-4
No files matched your search
+3
-3
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user