summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-07-11 13:42:23 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-07-11 13:42:23 +0000
commit59f688ef9082ac08656357442f27a443bff9c93b (patch)
tree1a4ce866dcf4a6d2de1624beb16a65a4fc5fc8c7
parentc33672ea1f9588318eb8262dd309886002f4f22e (diff)
downloadFreeBSD-src-59f688ef9082ac08656357442f27a443bff9c93b.zip
FreeBSD-src-59f688ef9082ac08656357442f27a443bff9c93b.tar.gz
If a thread is sending signal to its process, if the thread can handle
the signal itself, it should get it without looking for other threads.
-rw-r--r--sys/kern/kern_sig.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 099a7d0..0e4c5b5 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1553,10 +1553,11 @@ sigtd(struct proc *p, int sig, int prop)
/*
* If we know the signal is bound for a specific thread then we
* assume that we are in that threads context. This is the case
- * for SIGXCPU, SIGILL, etc. Otherwise someone did a kill() from
- * userland and the real thread doesn't actually matter.
+ * for SIGXCPU, SIGILL, etc. Otherwise someone did a kill() from
+ * userland, if current thread can handle the signal, it should
+ * get the signal.
*/
- if ((prop & SA_PROC) != 0 && curthread->td_proc == p)
+ if (curthread->td_proc == p && !SIGISMEMBER(curthread->td_sigmask, sig))
return (curthread);
/*
OpenPOWER on IntegriCloud