summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-05-22 11:03:51 +0000
committerjhb <jhb@FreeBSD.org>2015-05-22 11:03:51 +0000
commit9b4a921aab689f5712cf07c64a9f69f176ff2337 (patch)
treeb51401c0766e0bff9ee630e2735a4636eadd61a2 /sys/fs
parentca72ba8567faaab08c78edfe51e067a187fd4912 (diff)
downloadFreeBSD-src-9b4a921aab689f5712cf07c64a9f69f176ff2337.zip
FreeBSD-src-9b4a921aab689f5712cf07c64a9f69f176ff2337.tar.gz
Always set p_oppid when attaching to an existing process via procfs
tracing. This matches the behavior of ptrace(PT_ATTACH). Also, the procfs detach request assumes p_oppid is always set. Reviewed by: kib MFC after: 2 weeks
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/procfs/procfs_ctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c
index dc267f6..1437644 100644
--- a/sys/fs/procfs/procfs_ctl.c
+++ b/sys/fs/procfs/procfs_ctl.c
@@ -143,8 +143,8 @@ procfs_control(struct thread *td, struct proc *p, int op)
p->p_flag |= P_TRACED;
faultin(p);
p->p_xstat = 0; /* XXX ? */
+ p->p_oppid = p->p_pptr->p_pid;
if (p->p_pptr != td->td_proc) {
- p->p_oppid = p->p_pptr->p_pid;
proc_reparent(p, td->td_proc);
}
kern_psignal(p, SIGSTOP);
OpenPOWER on IntegriCloud