summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-03-10 06:27:22 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-03-10 06:27:22 +0000
commit161598ad7758da362b459d54e430675be7a627a1 (patch)
tree98e82640924a9f810bc0c7e03e1d30cc16344cd9 /sys/kern
parentd61a690bb1fb3482ac59dcc5921f333753c82a6b (diff)
Give sigwait priority over ptrace to avoid panic
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sig.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 9ab09b72920..b3a92976985 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.135 2012/03/10 05:54:28 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.136 2012/03/10 06:27:21 guenther Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -804,15 +804,17 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
/*
* If proc is traced, always give parent a chance.
+ * XXX give sigwait() priority until it's fixed to do this
+ * XXX from issignal/postsig
*/
- if (pr->ps_flags & PS_TRACED) {
- action = SIG_DFL;
- atomic_setbits_int(&p->p_siglist, mask);
- } else if (p->p_sigdivert & mask) {
+ if (p->p_sigdivert & mask) {
p->p_sigwait = signum;
atomic_clearbits_int(&p->p_sigdivert, ~0);
action = SIG_CATCH;
wakeup(&p->p_sigdivert);
+ } else if (pr->ps_flags & PS_TRACED) {
+ action = SIG_DFL;
+ atomic_setbits_int(&p->p_siglist, mask);
} else {
/*
* If the signal is being ignored,