From 9f5103abab87be32d544be565ea5c3d6f60d9050 Mon Sep 17 00:00:00 2001 From: Mariusz Zaborski Date: Mon, 5 Aug 2019 20:26:01 +0000 Subject: [PATCH] process: style We don't need to check if the parent is already set. This is done already in the proc_reparent. No functional behaviour changes intended. MFC after: 1 month --- sys/kern/sys_process.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 578aebeb9c65..d2b5ea2434a8 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -958,9 +958,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) * on a "detach". */ proc_set_traced(p, true); - if (p->p_pptr != td->td_proc) { - proc_reparent(p, td->td_proc, false); - } + proc_reparent(p, td->td_proc, false); CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid, p->p_oppid); @@ -1109,7 +1107,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) p->p_pid, psr->sr_error, psr->sr_retval[0], psr->sr_retval[1]); break; - + case PT_STEP: case PT_CONTINUE: case PT_TO_SCE: @@ -1219,8 +1217,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) sendsig: MPASS(proctree_locked == 0); - - /* + + /* * Clear the pending event for the thread that just * reported its event (p_xthread). This may not be * the thread passed to PT_CONTINUE, PT_STEP, etc. if