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:
jhb 2001-05-04 18:13:11 +00:00
parent 5ff7127b68
commit 79ebab510f

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);