aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2006-10-25 06:18:04 +0000
committerDavid Xu <davidxu@FreeBSD.org>2006-10-25 06:18:04 +0000
commitff7668079fdacf89d093376f9dbfa9c9b1a6f912 (patch)
tree2b0e8f6fd8ee218b26cec1b7e6a623b4bd535ff4 /sys
parent5b7aaa1a15b63fd2e2d5975b3096e64e0929cb1d (diff)
downloadsrc-ff7668079fdacf89d093376f9dbfa9c9b1a6f912.tar.gz
src-ff7668079fdacf89d093376f9dbfa9c9b1a6f912.zip
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_exit.c7
-rw-r--r--sys/kern/sys_process.c6
2 files changed, 4 insertions, 9 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 6ed8f4c0358d..6910903f3183 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -197,10 +197,6 @@ retry:
while (p->p_lock > 0)
msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0);
- PROC_LOCK(p->p_pptr);
- sigqueue_take(p->p_ksi);
- PROC_UNLOCK(p->p_pptr);
-
PROC_UNLOCK(p);
#ifdef AUDIT
@@ -903,6 +899,9 @@ proc_reparent(struct proc *child, struct proc *parent)
if (child->p_pptr == parent)
return;
+ PROC_LOCK(child->p_pptr);
+ sigqueue_take(child->p_ksi);
+ PROC_UNLOCK(child->p_pptr);
LIST_REMOVE(child, p_sibling);
LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
child->p_pptr = parent;
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 26dd0f7cc996..0624b6f1709a 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -690,12 +690,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
/* security check done above */
p->p_flag |= P_TRACED;
p->p_oppid = p->p_pptr->p_pid;
- if (p->p_pptr != td->td_proc) {
- PROC_LOCK(p->p_pptr);
- sigqueue_take(p->p_ksi);
- PROC_UNLOCK(p->p_pptr);
+ if (p->p_pptr != td->td_proc)
proc_reparent(p, td->td_proc);
- }
data = SIGSTOP;
goto sendsig; /* in PT_CONTINUE below */