summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-07-22 18:47:31 +0000
committerdillon <dillon@FreeBSD.org>2001-07-22 18:47:31 +0000
commit5064dfdc7ca942c44349640d82b2d486a6fae544 (patch)
tree2482e222def985b497ee47a2123f3ea4c3a0cc74 /sys
parentf322ed687376f4ac00e13420d79a8eade13c0189 (diff)
downloadFreeBSD-src-5064dfdc7ca942c44349640d82b2d486a6fae544.zip
FreeBSD-src-5064dfdc7ca942c44349640d82b2d486a6fae544.tar.gz
As per further discussions on hackers redo the SIGCHLD patch to not generate
an unexpected user-visible side effect with the sigaction flags. Also cleanup a minor union issue. Submitted by: Rudolf Cejka <cejkar@dcse.fee.vutbr.cz> MFC addendum: MFC will be combined w/ original commit MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_exit.c7
-rw-r--r--sys/kern/kern_sig.c9
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index d73c70b..4597f30 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -329,10 +329,11 @@ exit1(p, rv)
/*
* Notify parent that we're gone. If parent has the PS_NOCLDWAIT
- * flag set, notify process 1 instead (and hope it will handle
- * this situation).
+ * flag set, or if the handler is set to SIG_IGN, notify process
+ * 1 instead (and hope it will handle this situation).
*/
- if (p->p_pptr->p_procsig->ps_flag & PS_NOCLDWAIT) {
+ if ((p->p_pptr->p_procsig->ps_flag & PS_NOCLDWAIT)
+ || p->p_pptr->p_sigacts->ps_sigact[_SIG_IDX(SIGCHLD)] == SIG_IGN) {
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 4784e40..67945b0 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)] = act->sa_handler;
- SIGADDSET(ps->ps_siginfo, sig);
- } else {
ps->ps_sigact[_SIG_IDX(sig)] =
(__sighandler_t *)act->sa_sigaction;
+ SIGADDSET(ps->ps_siginfo, sig);
+ } else {
+ ps->ps_sigact[_SIG_IDX(sig)] = act->sa_handler;
SIGDELSET(ps->ps_siginfo, sig);
}
if (!(act->sa_flags & SA_RESTART))
@@ -289,8 +289,7 @@ 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) ||
- ps->ps_sigact[_SIG_IDX(SIGCHLD)] == SIG_IGN) {
+ if (act->sa_flags & SA_NOCLDWAIT) {
/*
* Paranoia: since SA_NOCLDWAIT is implemented
* by reparenting the dying child to PID 1 (and
OpenPOWER on IntegriCloud