← Commit list

e41fdbc27

Denis Vlasenko
Denis Vlasenko
2009-04-20
FAILED Duration: 31s

Subject

watchdog: enable it before setting timeout

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/watchdog.c+9 -2
@@ -59,13 +59,20 @@ int watchdog_main(int argc, char **argv)
/* WDIOC_SETTIMEOUT takes seconds, not milliseconds */
htimer_duration = htimer_duration / 1000;
#ifndef WDIOC_SETTIMEOUT
-#error WDIOC_SETTIMEOUT is not defined, cannot compile watchdog applet
+# error WDIOC_SETTIMEOUT is not defined, cannot compile watchdog applet
#else
+# if defined WDIOC_SETOPTIONS && defined WDIOS_ENABLECARD
+ {
+ static const int enable = WDIOS_ENABLECARD;
+ ioctl_or_warn(3, WDIOC_SETOPTIONS, (void*) &enable);
+ }
+# endif
ioctl_or_warn(3, WDIOC_SETTIMEOUT, &htimer_duration);
#endif
+
#if 0
ioctl_or_warn(3, WDIOC_GETTIMEOUT, &htimer_duration);
- printf("watchdog: SW timer is %dms, HW timer is %dms\n",
+ printf("watchdog: SW timer is %dms, HW timer is %ds\n",
stimer_duration, htimer_duration * 1000);
#endif