aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-04-20 09:53:03 +0000
committerOmar Polo <op@omarpolo.com>2021-04-20 09:53:03 +0000
commit3841a3693094ae7cc3cfd4f80da7f463e2756bcc (patch)
treee428b2641af6c205c3467a9ded3165ec0378caa5 /gmid.c
parent74c0c7e4ce3d0e576ce14a8928a9972d15010c1f (diff)
restore signal handlers before exec'ing CGI scripts
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gmid.c b/gmid.c
index e125d90..928b1a6 100644
--- a/gmid.c
+++ b/gmid.c
@@ -513,9 +513,6 @@ main(int argc, char **argv)
return 0;
}
- signal(SIGPIPE, SIG_IGN);
- signal(SIGCHLD, SIG_IGN);
-
if (!conf.foreground && !configless) {
if (daemon(1, 1) == -1)
err(1, "daemon");
@@ -531,6 +528,9 @@ main(int argc, char **argv)
if (conf.ipv6)
sock6 = make_socket(conf.port, AF_INET6);
+ signal(SIGPIPE, SIG_IGN);
+ signal(SIGCHLD, SIG_IGN);
+
if (configless) {
setup_configless(argc, argv, cgi);
return 0;