From aa7a4dae6dac90cc7142de2483bd99638a60f1ae Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 1 Aug 2001 20:35:24 +0000 Subject: [PATCH] Temporarily back out kern_sig.c rev 1.125 and kern_exit.c rev 1.131. This paniced my one of my machines one time too many :-( and there is no sign of a solution in the pipeline. The deltas are still easily available in cvs. The problem is that if the parent has been swapped out, the child process cannot grope around in the parent's UPAGES to see the sigact[] array or it will fault. This probably is a showstopper for this implementation anyway. --- sys/kern/kern_exit.c | 7 +++---- sys/kern/kern_sig.c | 9 +++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 4597f300d22..d73c70bb9df 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -329,11 +329,10 @@ exit1(p, rv) /* * Notify parent that we're gone. If parent has the PS_NOCLDWAIT - * flag set, or if the handler is set to SIG_IGN, notify process - * 1 instead (and hope it will handle this situation). + * flag set, notify process 1 instead (and hope it will handle + * this situation). */ - if ((p->p_pptr->p_procsig->ps_flag & PS_NOCLDWAIT) - || p->p_pptr->p_sigacts->ps_sigact[_SIG_IDX(SIGCHLD)] == SIG_IGN) { + if (p->p_pptr->p_procsig->ps_flag & PS_NOCLDWAIT) { struct proc *pp = p->p_pptr; proc_reparent(p, initproc); /* diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 67945b0bcfe..4784e40a06d 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -255,11 +255,11 @@ do_sigaction(p, sig, act, oact, old) ps->ps_catchmask[_SIG_IDX(sig)] = act->sa_mask; SIG_CANTMASK(ps->ps_catchmask[_SIG_IDX(sig)]); if (act->sa_flags & SA_SIGINFO) { - ps->ps_sigact[_SIG_IDX(sig)] = - (__sighandler_t *)act->sa_sigaction; + ps->ps_sigact[_SIG_IDX(sig)] = act->sa_handler; SIGADDSET(ps->ps_siginfo, sig); } else { - ps->ps_sigact[_SIG_IDX(sig)] = act->sa_handler; + ps->ps_sigact[_SIG_IDX(sig)] = + (__sighandler_t *)act->sa_sigaction; SIGDELSET(ps->ps_siginfo, sig); } if (!(act->sa_flags & SA_RESTART)) @@ -289,7 +289,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