diff options
author | Timur Tabi <timur@codeaurora.org> | 2016-06-21 19:00:15 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2016-07-17 15:02:32 -0400 |
commit | 5a2d3de1960260f34da84ac27bdc1345b541f2e8 (patch) | |
tree | 1ce58d3c592c88a309402381f97bb082c3002fc3 /Documentation/watchdog | |
parent | ee279c2734b07fb74031b1626b0f097cee9de5c8 (diff) |
Documentation/watchdog: add support for magic close to watchdog-test
Some drivers have the WDIOF_MAGICCLOSE set, which means that applications
need to write 'V' to the watchdog device before closing, otherwise the
driver won't stop the watchdog timer.
Signed-off-by: Timur Tabi <timur@codeaurora.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'Documentation/watchdog')
-rw-r--r-- | Documentation/watchdog/src/watchdog-test.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/watchdog/src/watchdog-test.c b/Documentation/watchdog/src/watchdog-test.c index b3cc7aa12a72..c69153913722 100644 --- a/Documentation/watchdog/src/watchdog-test.c +++ b/Documentation/watchdog/src/watchdog-test.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/watchdog.h> | 13 | #include <linux/watchdog.h> |
14 | 14 | ||
15 | int fd; | 15 | int fd; |
16 | const char v = 'V'; | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * This function simply sends an IOCTL to the driver, which in turn ticks | 19 | * This function simply sends an IOCTL to the driver, which in turn ticks |
@@ -34,6 +35,7 @@ static void keep_alive(void) | |||
34 | 35 | ||
35 | static void term(int sig) | 36 | static void term(int sig) |
36 | { | 37 | { |
38 | write(fd, &v, 1); | ||
37 | close(fd); | 39 | close(fd); |
38 | printf("\nStopping watchdog ticks...\n"); | 40 | printf("\nStopping watchdog ticks...\n"); |
39 | exit(0); | 41 | exit(0); |
@@ -89,6 +91,7 @@ int main(int argc, char *argv[]) | |||
89 | sleep(ping_rate); | 91 | sleep(ping_rate); |
90 | } | 92 | } |
91 | end: | 93 | end: |
94 | write(fd, &v, 1); | ||
92 | close(fd); | 95 | close(fd); |
93 | return 0; | 96 | return 0; |
94 | } | 97 | } |