From c7fd62da6c3f7683916a52370f6d0e57261a3fb8 Mon Sep 17 00:00:00 2001 From: David Malone Date: Mon, 11 Jun 2001 09:15:41 +0000 Subject: [PATCH] Try to make the setting of the SIGCHLD handler the same as setting of the NOCLDWAI flag. Susv2 seems to require this. Submitted by: Cejka Rudolf Reviewed by: dillon --- sys/kern/kern_sig.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ae682681843d..1307b5c08aa3 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -293,7 +293,8 @@ do_sigaction(p, sig, act, oact, old) p->p_procsig->ps_flag |= PS_NOCLDSTOP; else p->p_procsig->ps_flag &= ~PS_NOCLDSTOP; - if (act->sa_flags & SA_NOCLDWAIT) { + if ((act->sa_flags & SA_NOCLDWAIT) || + ps->ps_sigact[_SIG_IDX(SIGCHLD)] == SIG_IGN) { /* * Paranoia: since SA_NOCLDWAIT is implemented * by reparenting the dying child to PID 1 (and @@ -468,6 +469,8 @@ execsigs(p) * Reset no zombies if child dies flag as Solaris does. */ p->p_procsig->ps_flag &= ~PS_NOCLDWAIT; + if (ps->ps_sigact[_SIG_IDX(SIGCHLD)] == SIG_IGN) + ps->ps_sigact[_SIG_IDX(SIGCHLD)] = SIG_DFL; PROC_UNLOCK(p); }