summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-02-12 22:00:15 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-02-12 22:00:15 +0100
commit89b507932eeab9754d6a464a8ca7bde4815ac18a (patch)
treec00c3dc71696d4b07e024a40406ab5d40307f377
parent442581ed73847ba8ea34e7de4cd70eca3fd1d7bf (diff)
downloadrvnit-89b507932eeab9754d6a464a8ca7bde4815ac18a.tar.gz
rvnit-89b507932eeab9754d6a464a8ca7bde4815ac18a.tar.xz
rvnit-89b507932eeab9754d6a464a8ca7bde4815ac18a.zip
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.
-rw-r--r--rvnit.c9
1 files 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);