From 89b507932eeab9754d6a464a8ca7bde4815ac18a Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 12 Feb 2022 22:00:15 +0100 Subject: on shutdown, don't ignore signals as that will leak to children Instead, keep the on_signal handler, which does nothing really anymore, and enable SA_RESTART to avoid EINTR now. --- rvnit.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rvnit.c b/rvnit.c index fcc83f1..ecf56ec 100644 --- a/rvnit.c +++ b/rvnit.c @@ -994,11 +994,14 @@ fatal: own_console(); sigaction(SIGINT, &(struct sigaction){ - .sa_handler=SIG_IGN, .sa_mask=allset }, 0); + .sa_handler=on_signal, .sa_mask=allset, + .sa_flags=SA_RESTART }, 0); sigaction(SIGTERM, &(struct sigaction){ - .sa_handler=SIG_IGN, .sa_mask=allset }, 0); + .sa_handler=on_signal, .sa_mask=allset, + .sa_flags=SA_RESTART }, 0); sigaction(SIGCONT, &(struct sigaction){ - .sa_handler=SIG_IGN, .sa_mask=allset }, 0); + .sa_handler=on_signal, .sa_mask=allset, + .sa_flags=SA_RESTART }, 0); #ifdef __linux__ reboot(RB_ENABLE_CAD); -- cgit 1.4.1