X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/5e7a5e2d42c1b06f249debca72c10ad33d157402..94a1d5fce6a68fce8216d4b45ef6148d353c2c3a:/process.c diff --git a/process.c b/process.c index edc87ac..77fe38e 100644 --- a/process.c +++ b/process.c @@ -218,6 +218,10 @@ void afterfork(void) 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)) { @@ -301,9 +305,8 @@ void start_signal_handling(void) pipe_cloexec(p); spw=p[1]; spr=p[0]; - if (fcntl(spw, F_SETFL, fcntl(spw, F_GETFL)|O_NONBLOCK)==-1) { - fatal_perror("start_signal_handling: fcntl(O_NONBLOCK)"); - } + setnonblock(spw); + setnonblock(spr); register_for_poll(NULL,signal_beforepoll,signal_afterpoll,"signal"); signal_handling=True;