|
@@ -560,9 +560,6 @@ static void reparent_leader(struct task_struct *father, struct task_struct *p,
|
|
struct list_head *dead)
|
|
struct list_head *dead)
|
|
{
|
|
{
|
|
list_move_tail(&p->sibling, &p->real_parent->children);
|
|
list_move_tail(&p->sibling, &p->real_parent->children);
|
|
-
|
|
|
|
- if (p->exit_state == EXIT_DEAD)
|
|
|
|
- return;
|
|
|
|
/*
|
|
/*
|
|
* If this is a threaded reparent there is no need to
|
|
* If this is a threaded reparent there is no need to
|
|
* notify anyone anything has happened.
|
|
* notify anyone anything has happened.
|
|
@@ -570,9 +567,19 @@ static void reparent_leader(struct task_struct *father, struct task_struct *p,
|
|
if (same_thread_group(p->real_parent, father))
|
|
if (same_thread_group(p->real_parent, father))
|
|
return;
|
|
return;
|
|
|
|
|
|
- /* We don't want people slaying init. */
|
|
|
|
|
|
+ /*
|
|
|
|
+ * We don't want people slaying init.
|
|
|
|
+ *
|
|
|
|
+ * Note: we do this even if it is EXIT_DEAD, wait_task_zombie()
|
|
|
|
+ * can change ->exit_state to EXIT_ZOMBIE. If this is the final
|
|
|
|
+ * state, do_notify_parent() was already called and ->exit_signal
|
|
|
|
+ * doesn't matter.
|
|
|
|
+ */
|
|
p->exit_signal = SIGCHLD;
|
|
p->exit_signal = SIGCHLD;
|
|
|
|
|
|
|
|
+ if (p->exit_state == EXIT_DEAD)
|
|
|
|
+ return;
|
|
|
|
+
|
|
/* If it has exited notify the new parent about this child's death. */
|
|
/* If it has exited notify the new parent about this child's death. */
|
|
if (!p->ptrace &&
|
|
if (!p->ptrace &&
|
|
p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) {
|
|
p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) {
|