Recently Written · git

sacc

Mirror of git://bitreich.org/sacc, the sacc gopher client from bitreich.org.

git clone https://github.com/equwal/sacc

Log | Files | Refs


commit b15d084107da05069a3cf70cd81475f26d8e563e
Hiltjo Posthuma <hiltjo@codemadness.org>
2022-03-27 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.

 sacc.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/sacc.c b/sacc.c
index 6af6ac2..a3553fb 100644
--- 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)) {