mirror of
https://github.com/troglobit/finit.git
synced 2026-11-20 19:41:51 +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;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int loop(int fd)
|
static int loop(int fd, int period)
|
||||||
{
|
{
|
||||||
int dummy = 0;
|
int dummy = 0;
|
||||||
|
|
||||||
while (running) {
|
while (running) {
|
||||||
do_sleep(1);
|
|
||||||
ioctl(fd, WDIOC_KEEPALIVE, &dummy);
|
ioctl(fd, WDIOC_KEEPALIVE, &dummy);
|
||||||
|
sleep(period);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handover) {
|
if (handover) {
|
||||||
@@ -87,7 +87,7 @@ int watchdog(char *progname)
|
|||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = loop(fd);
|
ret = loop(fd, WDT_TIMEOUT / 2);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
_exit(ret);
|
_exit(ret);
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
#include "config.h" /* Generated by configure script */
|
#include "config.h" /* Generated by configure script */
|
||||||
|
|
||||||
#define WDT_DEVNODE "/dev/watchdog"
|
#define WDT_DEVNODE "/dev/watchdog"
|
||||||
#define WDT_TIMEOUT 3
|
#define WDT_TIMEOUT 30
|
||||||
|
|
||||||
#ifdef BUILTIN_WATCHDOG
|
#ifdef BUILTIN_WATCHDOG
|
||||||
int watchdog(char *progname);
|
int watchdog(char *progname);
|
||||||
|
|||||||
Reference in new issue
Block a user