Commit a61b6024 authored by Linus Torvalds's avatar Linus Torvalds

Clean up ptrace child exit case.

This also fixes it for when the real parent is ignoring
SIGCHLD - noted by David Mosberger.
parent 6bf1545b
...@@ -1018,19 +1018,16 @@ static int wait_task_zombie(task_t *p, unsigned int __user *stat_addr, struct ru ...@@ -1018,19 +1018,16 @@ static int wait_task_zombie(task_t *p, unsigned int __user *stat_addr, struct ru
if (p->real_parent != p->parent) { if (p->real_parent != p->parent) {
__ptrace_unlink(p); __ptrace_unlink(p);
p->state = TASK_ZOMBIE; p->state = TASK_ZOMBIE;
/* If this is a detached thread, this is where it goes away. */ /*
if (p->exit_signal == -1) { * If this is not a detached task, notify the parent. If it's
/* release_task takes the lock itself. */ * still not detached after that, don't release it now.
write_unlock_irq(&tasklist_lock); */
release_task (p); if (p->exit_signal != -1) {
}
else {
do_notify_parent(p, p->exit_signal); do_notify_parent(p, p->exit_signal);
write_unlock_irq(&tasklist_lock); if (p->exit_signal != -1)
}
p = NULL; p = NULL;
} }
else }
write_unlock_irq(&tasklist_lock); write_unlock_irq(&tasklist_lock);
} }
if (p != NULL) if (p != NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment