diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 5132d2e9711b..221a84c26e89 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -409,7 +409,7 @@ setpgid(struct thread *td, register struct setpgid_args *uap) error = ESRCH; goto done; } - if ((error = p_cansee(curthread, targp))) { + if ((error = p_cansee(td, targp))) { PROC_UNLOCK(targp); goto done; }