From: Timur Tabi Date: Tue, 21 Jun 2016 23:00:15 +0000 (-0500) Subject: Documentation/watchdog: add support for magic close to watchdog-test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5a2d3de1960260f34da84ac27bdc1345b541f2e8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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 @@ #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; }