From 3c11c47faf8af11fc18557a124d543bc1d0c22cb Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 15 Oct 2020 19:09:56 -0500 Subject: Patrick Oppenlander suggested watchdog also catch SIGINT. --- toys/pending/watchdog.c | 1 + 1 file changed, 1 insertion(+) (limited to 'toys/pending') diff --git a/toys/pending/watchdog.c b/toys/pending/watchdog.c index d1279bd4..ea29d02e 100644 --- a/toys/pending/watchdog.c +++ b/toys/pending/watchdog.c @@ -38,6 +38,7 @@ void watchdog_main(void) { if (!FLAG(F) && daemon(1, 1)) perror_exit("failed to daemonize"); xsignal(SIGTERM, safe_shutdown); + xsignal(SIGINT, safe_shutdown); xioctl(TT.fd = xopen(*toys.optargs, O_WRONLY), WDIOC_SETTIMEOUT, &TT.T); // Now that we've got the watchdog device open, kick it periodically. -- cgit v1.2.3