Author: oshogbo
Date: Tue Sep 10 20:20:45 2019
New Revision: 352184
URL: https://svnweb.freebsd.org/changeset/base/352184

Log:
  MFCr350616:
    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

Modified:
  stable/12/sys/kern/sys_process.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/sys_process.c
==============================================================================
--- stable/12/sys/kern/sys_process.c    Tue Sep 10 20:19:29 2019        
(r352183)
+++ stable/12/sys/kern/sys_process.c    Tue Sep 10 20:20:45 2019        
(r352184)
@@ -929,9 +929,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
                 * 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);
 
@@ -1048,7 +1046,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
                        bcopy(td2->td_sa.args, addr, td2->td_sa.narg *
                            sizeof(register_t));
                break;
-               
+
        case PT_STEP:
        case PT_CONTINUE:
        case PT_TO_SCE:
@@ -1158,8 +1156,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
 
        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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to