提交 5a2d3de1 编写于 作者: T Timur Tabi 提交者: Wim Van Sebroeck

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: NTimur Tabi <timur@codeaurora.org>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 ee279c27
......@@ -13,6 +13,7 @@
#include <linux/watchdog.h>
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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册