From 5a2d3de1960260f34da84ac27bdc1345b541f2e8 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Tue, 21 Jun 2016 18:00:15 -0500 Subject: 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 Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- Documentation/watchdog/src/watchdog-test.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/watchdog') diff --git a/Documentation/watchdog/src/watchdog-test.c b/Documentation/watchdog/src/watchdog-test.c index b3cc7aa..c691539 100644 --- a/Documentation/watchdog/src/watchdog-test.c +++ b/Documentation/watchdog/src/watchdog-test.c @@ -13,6 +13,7 @@ #include int fd; +const char v = 'V'; /* * This function simply sends an IOCTL to the driver, which in turn ticks @@ -34,6 +35,7 @@ static void keep_alive(void) static void term(int sig) { + write(fd, &v, 1); close(fd); printf("\nStopping watchdog ticks...\n"); exit(0); @@ -89,6 +91,7 @@ int main(int argc, char *argv[]) sleep(ping_rate); } end: + write(fd, &v, 1); close(fd); return 0; } -- cgit v1.1