aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-10-15 19:09:56 -0500
committerRob Landley <rob@landley.net>2020-10-15 19:09:56 -0500
commit3c11c47faf8af11fc18557a124d543bc1d0c22cb (patch)
tree4a4a1df77bc84ace4abd8435eb2e764b0a9e0d68
parent0b18e14e80a5627f67eb093c556bf2fa5014718c (diff)
downloadtoybox-3c11c47faf8af11fc18557a124d543bc1d0c22cb.tar.gz
Patrick Oppenlander suggested watchdog also catch SIGINT.
-rw-r--r--toys/pending/watchdog.c1
1 files changed, 1 insertions, 0 deletions
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.