Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Timur Tabi and committed by
Wim Van Sebroeck
5a2d3de1 ee279c27

+3
+3
Documentation/watchdog/src/watchdog-test.c
··· 13 13 #include <linux/watchdog.h> 14 14 15 15 int fd; 16 + const char v = 'V'; 16 17 17 18 /* 18 19 * This function simply sends an IOCTL to the driver, which in turn ticks ··· 35 34 36 35 static void term(int sig) 37 36 { 37 + write(fd, &v, 1); 38 38 close(fd); 39 39 printf("\nStopping watchdog ticks...\n"); 40 40 exit(0); ··· 91 89 sleep(ping_rate); 92 90 } 93 91 end: 92 + write(fd, &v, 1); 94 93 close(fd); 95 94 return 0; 96 95 }