diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-20 09:26:17 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-20 09:26:17 +0000 |
commit | e41fdbc2795e098887af2c5bff3294753b97ffb5 (patch) | |
tree | b58d80036beaa95082fc2fcd43688146e7a7d6af /miscutils/watchdog.c | |
parent | 8c64e033c0076196a6d7d30ddd922cd6feb15c13 (diff) | |
download | busybox-w32-e41fdbc2795e098887af2c5bff3294753b97ffb5.tar.gz busybox-w32-e41fdbc2795e098887af2c5bff3294753b97ffb5.tar.bz2 busybox-w32-e41fdbc2795e098887af2c5bff3294753b97ffb5.zip |
watchdog: enable it before setting timeout
function old new delta
watchdog_main 239 259 +20
static.enable - 4 +4
Diffstat (limited to 'miscutils/watchdog.c')
-rw-r--r-- | miscutils/watchdog.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index f85138e11..893cef0ac 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
@@ -59,13 +59,20 @@ int watchdog_main(int argc, char **argv) | |||
59 | /* WDIOC_SETTIMEOUT takes seconds, not milliseconds */ | 59 | /* WDIOC_SETTIMEOUT takes seconds, not milliseconds */ |
60 | htimer_duration = htimer_duration / 1000; | 60 | htimer_duration = htimer_duration / 1000; |
61 | #ifndef WDIOC_SETTIMEOUT | 61 | #ifndef WDIOC_SETTIMEOUT |
62 | #error WDIOC_SETTIMEOUT is not defined, cannot compile watchdog applet | 62 | # error WDIOC_SETTIMEOUT is not defined, cannot compile watchdog applet |
63 | #else | 63 | #else |
64 | # if defined WDIOC_SETOPTIONS && defined WDIOS_ENABLECARD | ||
65 | { | ||
66 | static const int enable = WDIOS_ENABLECARD; | ||
67 | ioctl_or_warn(3, WDIOC_SETOPTIONS, (void*) &enable); | ||
68 | } | ||
69 | # endif | ||
64 | ioctl_or_warn(3, WDIOC_SETTIMEOUT, &htimer_duration); | 70 | ioctl_or_warn(3, WDIOC_SETTIMEOUT, &htimer_duration); |
65 | #endif | 71 | #endif |
72 | |||
66 | #if 0 | 73 | #if 0 |
67 | ioctl_or_warn(3, WDIOC_GETTIMEOUT, &htimer_duration); | 74 | ioctl_or_warn(3, WDIOC_GETTIMEOUT, &htimer_duration); |
68 | printf("watchdog: SW timer is %dms, HW timer is %dms\n", | 75 | printf("watchdog: SW timer is %dms, HW timer is %ds\n", |
69 | stimer_duration, htimer_duration * 1000); | 76 | stimer_duration, htimer_duration * 1000); |
70 | #endif | 77 | #endif |
71 | 78 | ||