Fix a bug in the pfind() changes due to confusing the process returned by

pfind() ('pp') with the process being detached from ptrace.

Reported by:	bde
This commit is contained in:
John Baldwin 2001-05-04 18:13:11 +00:00
parent f21559815d
commit 6c49a8e295
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76274

View file

@ -381,7 +381,12 @@ ptrace(curp, uap)
struct proc *pp;
pp = pfind(p->p_oppid);
proc_reparent(p, pp ? pp : initproc);
if (pp != NULL)
PROC_UNLOCK(pp);
else
pp = initproc;
PROC_LOCK(p);
proc_reparent(p, pp);
} else
PROC_LOCK(p);
p->p_flag &= ~(P_TRACED | P_WAITED);