Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189545
b: refs/heads/master
c: dfc3338
h: refs/heads/master
i:
  189543: fba94fd
v: v3
  • Loading branch information
James Hogan authored and Wim Van Sebroeck committed Apr 6, 2010
1 parent f798c50 commit 346eb4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf9cf9aed19f529ff313c3e0901ae3b2972eaf4e
refs/heads/master: dfc333834cb86805485920dc77ee0f2fbb484462
8 changes: 6 additions & 2 deletions trunk/Documentation/watchdog/src/watchdog-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions trunk/Documentation/watchdog/watchdog-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,10 @@ returned value is the temperature in degrees fahrenheit.
ioctl(fd, WDIOC_GETTEMP, &temperature);

Finally the SETOPTIONS ioctl can be used to control some aspects of
the cards operation; right now the pcwd driver is the only one
supporting this ioctl.
the cards operation.

int options = 0;
ioctl(fd, WDIOC_SETOPTIONS, options);
ioctl(fd, WDIOC_SETOPTIONS, &options);

The following options are available:

Expand Down

0 comments on commit 346eb4c

Please sign in to comment.