chiark / gitweb /
process: Clear SHUTDOWN hooks in afterfork()
[secnet.git] / process.c
index a15e3a6357f385dbd76115283699b7656ade439a..77fe38e3127134077d8cbdbc3e6e460bcefaf942 100644 (file)
--- a/process.c
+++ b/process.c
@@ -218,6 +218,10 @@ void afterfork(void)
     sigset_t done;
     struct sigaction sa;
 
     sigset_t done;
     struct sigaction sa;
 
+    clear_phase_hooks(PHASE_SHUTDOWN);
+    /* Prevents calls to fatal() etc. in the child from running off
+       and doing a lot of unhelpful things */
+
     sigemptyset(&done);
     for (n=sigs; n; n=n->next)
        if (!sigismember(&done,n->signum)) {
     sigemptyset(&done);
     for (n=sigs; n; n=n->next)
        if (!sigismember(&done,n->signum)) {