summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNolan Prescott <mail@nprescott.com>2021-02-07 00:51:10 -0500
committerDrew DeVault <sir@cmpwn.com>2021-02-07 08:07:05 -0500
commit6d9dd838e439bbc730d12ce81214046cde9227dd (patch)
tree0257436eb669b7c0c2ef1e7886884fbbc39c87a1
parentd1ccb60a52d2f6d91ec65d575927afc7039df0b6 (diff)
downloadgmnisrv-6d9dd838e439bbc730d12ce81214046cde9227dd.tar.gz
gmnisrv-6d9dd838e439bbc730d12ce81214046cde9227dd.tar.xz
gmnisrv-6d9dd838e439bbc730d12ce81214046cde9227dd.zip
ignore SIGCHLD to prevent CGI zombies
with nothing waiting on the forked processes there is no reason not to reap the CGI process on exit intended to address issue from mailing list "gmnisrv uses too many tasks" <163806E8-A16A-463E-8C62-43E903EF1E35@librem.one>
-rw-r--r--src/serve.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/serve.c b/src/serve.c
index e891d42..4b63dde 100644
--- a/src/serve.c
+++ b/src/serve.c
@@ -5,6 +5,7 @@
#include <fcntl.h>
#include <libgen.h>
#include <limits.h>
+#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
@@ -141,6 +142,7 @@ serve_cgi(struct gmnisrv_client *client, const char *path,
return;
}
+ signal(SIGCHLD, SIG_IGN);
pid_t pid = fork();
if (pid == -1) {
server_error("fork: %s", strerror(errno));