summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-08-31 07:15:50 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-08-31 07:15:50 +0000
commitae90c2fd0986f5829f4fdfc1a2137c52f77846cb (patch)
treebb07d1f42b620cf4e877945a77b06ed384c982a9 /sys/kern/kern_sig.c
parent7476d01cc94f357f807b60f841f009434854ffbb (diff)
downloadFreeBSD-src-ae90c2fd0986f5829f4fdfc1a2137c52f77846cb.zip
FreeBSD-src-ae90c2fd0986f5829f4fdfc1a2137c52f77846cb.tar.gz
If a process is being debugged, skips job control caused by SIGSTOP/SIGCONT
signals, because it is managed by debugger, however a normal signal sent to a interruptibly sleeping thread wakes up the thread so it will handle the signal when the process leaves the stopped state. PR: 150138 MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index c620bdc..9cbbe8d 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2139,20 +2139,9 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
* We try do the per-process part here.
*/
if (P_SHOULDSTOP(p)) {
- /*
- * The process is in stopped mode. All the threads should be
- * either winding down or already on the suspended queue.
- */
- if (p->p_flag & P_TRACED) {
- /*
- * The traced process is already stopped,
- * so no further action is necessary.
- * No signal can restart us.
- */
- goto out;
- }
-
if (sig == SIGKILL) {
+ if (p->p_flag & P_TRACED)
+ goto out;
/*
* SIGKILL sets process running.
* It will die elsewhere.
@@ -2163,6 +2152,8 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
}
if (prop & SA_CONT) {
+ if (p->p_flag & P_TRACED)
+ goto out;
/*
* If SIGCONT is default (or ignored), we continue the
* process but don't leave the signal in sigqueue as
@@ -2207,6 +2198,8 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
}
if (prop & SA_STOP) {
+ if (p->p_flag & P_TRACED)
+ goto out;
/*
* Already stopped, don't need to stop again
* (If we did the shell could get confused).
OpenPOWER on IntegriCloud