diff options
-rw-r--r-- | sys/kern/kern_exit.c | 12 | ||||
-rw-r--r-- | sys/sys/proc.h | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 8a665ea63bdf..458912a504d0 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -167,8 +167,8 @@ reaper_clear(struct proc *p) proc_id_clear(PROC_ID_REAP, p->p_reapsubtree); } -static void -clear_orphan(struct proc *p) +void +proc_clear_orphan(struct proc *p) { struct proc *p1; @@ -522,7 +522,7 @@ exit1(struct thread *td, int rval, int signo) * list due to present P_TRACED flag. Clear * orphan link for q now while q is locked. */ - clear_orphan(q); + proc_clear_orphan(q); q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); q->p_flag2 &= ~P2_PTRACE_FSTP; q->p_ptevents = 0; @@ -556,7 +556,7 @@ exit1(struct thread *td, int rval, int signo) kern_psignal(q, q->p_pdeathsig); CTR2(KTR_PTRACE, "exit: pid %d, clearing orphan %d", p->p_pid, q->p_pid); - clear_orphan(q); + proc_clear_orphan(q); PROC_UNLOCK(q); } @@ -912,7 +912,7 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options) reaper_clear(p); proc_id_clear(PROC_ID_PID, p->p_pid); PROC_LOCK(p); - clear_orphan(p); + proc_clear_orphan(p); PROC_UNLOCK(p); leavepgrp(p); if (p->p_procdesc != NULL) @@ -1372,7 +1372,7 @@ proc_reparent(struct proc *child, struct proc *parent, bool set_oppid) LIST_REMOVE(child, p_sibling); LIST_INSERT_HEAD(&parent->p_children, child, p_sibling); - clear_orphan(child); + proc_clear_orphan(child); if (child->p_flag & P_TRACED) { if (LIST_EMPTY(&child->p_pptr->p_orphans)) { child->p_treeflag |= P_TREE_FIRST_ORPHAN; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 54728697b945..feaa64af654c 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1074,6 +1074,7 @@ void proc_wkilled(struct proc *p); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); +void proc_clear_orphan(struct proc *p); void reaper_abandon_children(struct proc *p, bool exiting); int securelevel_ge(struct ucred *cr, int level); int securelevel_gt(struct ucred *cr, int level); |