summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2005-12-22 06:58:21 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2005-12-22 06:58:21 +0000
commit7658356de5013efb24b967df9a37b87aeaf5cd31 (patch)
tree16404596b76ddaabd0c15b010c960e17b951d89d /sys/kern
parent14d889fb3cca316e399b08b9c75cd9d73b766c97 (diff)
1. when signalling a process group, don't deliver a copy to every thread
2. when delivering a STOP or CONT signal to a process, now replicate to every thread. makes ^Z and fg work nicer, first noticed by peter hessler. signals and threads are not right, but this is at least a little less wrong.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sig.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 9656982fe7c..5a2a913667b 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.78 2005/12/03 18:09:08 tedu Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.79 2005/12/22 06:58:20 tedu Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -705,7 +705,8 @@ pgsignal(struct pgrp *pgrp, int signum, int checkctty)
if (pgrp)
LIST_FOREACH(p, &pgrp->pg_members, p_pglist)
- if (checkctty == 0 || p->p_flag & P_CONTROLT)
+ if ((checkctty == 0 || p->p_flag & P_CONTROLT) &&
+ (p->p_flag & P_THREAD) == 0)
psignal(p, signum);
}
@@ -831,10 +832,15 @@ psignal(struct proc *p, int signum)
}
}
- if (prop & SA_CONT)
+ if (prop & SA_CONT) {
+ LIST_FOREACH(q, &p->p_thrchildren, p_thrsib)
+ psignal(q, signum);
p->p_siglist &= ~stopsigmask;
+ }
if (prop & SA_STOP) {
+ LIST_FOREACH(q, &p->p_thrchildren, p_thrsib)
+ psignal(q, signum);
p->p_siglist &= ~contsigmask;
p->p_flag &= ~P_CONTINUED;
}