commit b15d084107da05069a3cf70cd81475f26d8e563e
parent edbf8409a1e281d17422e7b12b5edd3832b4429d
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 27 Mar 2022 11:47:44 +0200
Ignore SIGCHLD to prevent zombie processes for non-modal plumbing
In config.h, when modalplumber = 0 is set (the default),
sacc does not wait(2) on the process
when a child process exits
and it then becomes a zombie on Linux.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/sacc.c b/sacc.c
@@ -1079,6 +1079,9 @@ setup(void)
sigaction(SIGHUP, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
+ sa.sa_handler = SIG_IGN;
+ sigaction(SIGCHLD, &sa, NULL);
+
if (!mkdtemp(tmpdir))
die("mkdir: %s: %s", tmpdir, strerror(errno));
if (interactive = isatty(1)) {