When the original parent of a process *is* its debugger there's no need
to reparent the child upon exit.  Diff below prevents a double status
report.

It is the same diff I already sent without the bad typo.

ok?

Index: kern/kern_exit.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_exit.c,v
retrieving revision 1.184
diff -u -p -r1.184 kern_exit.c
--- kern/kern_exit.c    28 Feb 2020 17:03:05 -0000      1.184
+++ kern/kern_exit.c    28 Feb 2020 17:04:18 -0000
@@ -584,7 +584,8 @@ proc_finish_wait(struct proc *waiter, st
         * we need to give it back to the old parent.
         */
        pr = p->p_p;
-       if (pr->ps_oppid && (tr = prfind(pr->ps_oppid))) {
+       if (pr->ps_oppid != 0 && (pr->ps_oppid != pr->ps_pptr->ps_pid) &&
+          (tr = prfind(pr->ps_oppid))) {
                atomic_clearbits_int(&pr->ps_flags, PS_TRACED);
                pr->ps_oppid = 0;
                proc_reparent(pr, tr);

Reply via email to