From 60381203e0958d57b4767276e260c2418e3768de Mon Sep 17 00:00:00 2001 From: yamt Date: Sat, 8 Mar 2008 07:56:53 +0000 Subject: [PATCH] kpsignal2: enqueue SA_STOP signals and let issignal handle it rather than trying to stop the process by ourselves. this fixes SIGTSTP masking. ok'ed by Andrew Doran. PR/37603, PR/38060. --- sys/kern/kern_sig.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 904251e4cc47..edd383cf94bc 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig.c,v 1.272 2008/02/20 11:48:46 yamt Exp $ */ +/* $NetBSD: kern_sig.c,v 1.273 2008/03/08 07:56:53 yamt Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.272 2008/02/20 11:48:46 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.273 2008/03/08 07:56:53 yamt Exp $"); #include "opt_ptrace.h" #include "opt_multiprocessor.h" @@ -1352,23 +1352,7 @@ kpsignal2(struct proc *p, ksiginfo_t *ksi) if ((prop & SA_CONT) != 0 && action == SIG_DFL) goto out; - if ((prop & SA_STOP) != 0 && action == SIG_DFL) { - /* - * If a child holding parent blocked, stopping could - * cause deadlock: discard the signal. - */ - if ((p->p_sflag & PS_PPWAIT) == 0) { - p->p_xstat = signo; - proc_stop(p, 1, signo); - } - goto out; - } else { - /* - * Stop signals with the default action are handled - * specially in issignal(), and so are not enqueued. - */ - sigput(&p->p_sigpend, p, kp); - } + sigput(&p->p_sigpend, p, kp); } else { /* * Process is stopped or stopping. If traced, then no