diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-17 07:51:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-17 07:51:57 -0700 |
commit | a61b6024bf3994699216d212a2c48e123dca5db1 (patch) | |
tree | 3f49f7c3fa79179edeb2901f63c24fd86c12f500 /kernel | |
parent | 6bf1545b847e64e7f048fda19c24297c95a00cf6 (diff) | |
download | history-a61b6024bf3994699216d212a2c48e123dca5db1.tar.gz |
Clean up ptrace child exit case.
This also fixes it for when the real parent is ignoring
SIGCHLD - noted by David Mosberger.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 5d13c054d2565..2b2f728220e41 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1018,20 +1018,17 @@ static int wait_task_zombie(task_t *p, unsigned int __user *stat_addr, struct ru if (p->real_parent != p->parent) { __ptrace_unlink(p); p->state = TASK_ZOMBIE; - /* If this is a detached thread, this is where it goes away. */ - if (p->exit_signal == -1) { - /* release_task takes the lock itself. */ - write_unlock_irq(&tasklist_lock); - release_task (p); - } - else { + /* + * If this is not a detached task, notify the parent. If it's + * still not detached after that, don't release it now. + */ + if (p->exit_signal != -1) { 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) release_task(p); |