ptrace: restructure comments around reparenting on PT_DETACH
style code, and use {} for both branches. Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
9d7e450b64
commit
a091c35323
@ -1005,14 +1005,16 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
|
||||
break;
|
||||
case PT_DETACH:
|
||||
/*
|
||||
* Reset the process parent.
|
||||
*
|
||||
* NB: This clears P_TRACED before reparenting
|
||||
* Clear P_TRACED before reparenting
|
||||
* a detached process back to its original
|
||||
* parent. Otherwise the debugee will be set
|
||||
* as an orphan of the debugger.
|
||||
*/
|
||||
p->p_flag &= ~(P_TRACED | P_WAITED);
|
||||
|
||||
/*
|
||||
* Reset the process parent.
|
||||
*/
|
||||
if (p->p_oppid != p->p_pptr->p_pid) {
|
||||
PROC_LOCK(p->p_pptr);
|
||||
sigqueue_take(p->p_ksi);
|
||||
@ -1025,9 +1027,11 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
|
||||
CTR3(KTR_PTRACE,
|
||||
"PT_DETACH: pid %d reparented to pid %d, sig %d",
|
||||
p->p_pid, pp->p_pid, data);
|
||||
} else
|
||||
} else {
|
||||
CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d",
|
||||
p->p_pid, data);
|
||||
}
|
||||
|
||||
p->p_ptevents = 0;
|
||||
FOREACH_THREAD_IN_PROC(p, td3) {
|
||||
if ((td3->td_dbgflags & TDB_FSTP) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user