diff options
author | jhb <jhb@FreeBSD.org> | 2015-05-22 11:03:51 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-05-22 11:03:51 +0000 |
commit | 9b4a921aab689f5712cf07c64a9f69f176ff2337 (patch) | |
tree | b51401c0766e0bff9ee630e2735a4636eadd61a2 | |
parent | ca72ba8567faaab08c78edfe51e067a187fd4912 (diff) | |
download | FreeBSD-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
-rw-r--r-- | sys/fs/procfs/procfs_ctl.c | 2 |
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); |