aboutsummaryrefslogtreecommitdiff
path: root/Documentation/watchdog/src/watchdog-test.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-04-11 02:44:30 -0700
committerDavid S. Miller <davem@davemloft.net>2010-04-11 02:44:30 -0700
commit4a1032faac94ebbf647460ae3e06fc21146eb280 (patch)
tree7f31b97beb0406faa1523e619289ad0ab07c9787 /Documentation/watchdog/src/watchdog-test.c
parentae4e8d63b5619d4d95f1d2bfa2b836caa6e62d06 (diff)
parent0eddb519b9127c73d53db4bf3ec1d45b13f844d1 (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'Documentation/watchdog/src/watchdog-test.c')
-rw-r--r--Documentation/watchdog/src/watchdog-test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Documentation/watchdog/src/watchdog-test.c b/Documentation/watchdog/src/watchdog-test.c
index a750532ffcf..63fdc34ceb9 100644
--- a/Documentation/watchdog/src/watchdog-test.c
+++ b/Documentation/watchdog/src/watchdog-test.c
@@ -31,6 +31,8 @@ static void keep_alive(void)
*/
int main(int argc, char *argv[])
{
+ int flags;
+
fd = open("/dev/watchdog", O_WRONLY);
if (fd == -1) {
@@ -41,12 +43,14 @@ int main(int argc, char *argv[])
if (argc > 1) {
if (!strncasecmp(argv[1], "-d", 2)) {
- ioctl(fd, WDIOC_SETOPTIONS, WDIOS_DISABLECARD);
+ flags = WDIOS_DISABLECARD;
+ ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card disabled.\n");
fflush(stderr);
exit(0);
} else if (!strncasecmp(argv[1], "-e", 2)) {
- ioctl(fd, WDIOC_SETOPTIONS, WDIOS_ENABLECARD);
+ flags = WDIOS_ENABLECARD;
+ ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card enabled.\n");
fflush(stderr);
exit(0);