Do preserve the error result from calling p_cansee() and use that when

failing because of the error.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
This commit is contained in:
Robert Watson 2002-07-20 22:44:39 +00:00
parent 9f977fb187
commit 4f18efe220

View File

@ -392,10 +392,8 @@ ptrace(struct thread *td, struct ptrace_args *uap)
return (ESRCH);
}
}
if (p_cansee(td, p)) {
error = ESRCH;
if ((error = p_cansee(td, p)) != 0)
goto fail;
}
if ((error = p_candebug(td, p)) != 0)
goto fail;