Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163403724
D58331.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D58331.diff
View Options
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -720,6 +720,9 @@
}
} else
PROC_LOCK(p->p_pptr);
+ nq = proc_realparent(p);
+ if (p->p_pptr != nq)
+ wakeup(nq);
sx_xunlock(&proctree_lock);
if (signal_parent == 1) {
@@ -1259,6 +1262,14 @@
return (0);
}
+ if (check_only) {
+ if ((p->p_flag2 & P2_ORPHAN_REPORTED) != 0) {
+ PROC_UNLOCK(p);
+ return (0);
+ }
+ p->p_flag2 |= P2_ORPHAN_REPORTED;
+ }
+
/*
* This special case handles a kthread spawned by linux_clone
* (see linux_misc.c). The linux_wait4 and linux_waitpid
@@ -1527,8 +1538,9 @@
KASSERT(ret != -1, ("reaped an orphan (pid %d)",
(int)td->td_retval[0]));
PROC_UNLOCK(p);
- nfound++;
- break;
+ td->td_retval[0] = p->p_pid;
+ sx_xunlock(&proctree_lock);
+ return (0);
}
}
}
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -905,6 +905,7 @@
#define P2_HWT 0x02000000 /* Process is using HWT. */
#define P2_ZOMBIEREF_PARENT 0x04000000
#define P2_ZOMBIEREF_PROCDESC 0x08000000
+#define P2_ORPHAN_REPORTED 0x10000000
/* Flags protected by proctree_lock, kept in p_treeflags. */
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 9:57 PM (22 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35356413
Default Alt Text
D58331.diff (1 KB)
Attached To
Mode
D58331: wait6(): fix reporting of orphan exits
Attached
Detach File
Event Timeline
Log In to Comment