diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 8392c8376499..588b43c606fe 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -749,7 +749,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) case PT_ATTACH: /* Self */ - if (p->p_pid == td->td_proc->p_pid) { + if (p == td->td_proc) { error = EINVAL; goto fail; }