aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-31 05:04:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-01 15:01:11 -0400
commit5c7edcd7ee6b77b88252fe4096dce1a46a60c829 (patch)
tree4936df589df33c671e2e98ea45b89e7f45278f61 /kernel/exit.c
parent1e24b15b267293567a8d752721c7ae63f281325a (diff)
tracehook: fix exit_signal=0 case
My commit 2b2a1ff64afbadac842bbc58c5166962cf4f7664 introduced a regression (sorry about that) for the odd case of exit_signal=0 (e.g. clone_flags=0). This is not a normal use, but it's used by a case in the glibc test suite. Dying with exit_signal=0 sends no signal, but it's supposed to wake up a parent's blocked wait*() calls (unlike the delayed_group_leader case). This fixes tracehook_notify_death() and its caller to distinguish a "signal 0" wakeup from the delayed_group_leader case (with no wakeup). Signed-off-by: Roland McGrath <roland@redhat.com> Tested-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index eb4d6470d1d0..38ec40630149 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -911,10 +911,10 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
911 tsk->exit_signal = SIGCHLD; 911 tsk->exit_signal = SIGCHLD;
912 912
913 signal = tracehook_notify_death(tsk, &cookie, group_dead); 913 signal = tracehook_notify_death(tsk, &cookie, group_dead);
914 if (signal > 0) 914 if (signal >= 0)
915 signal = do_notify_parent(tsk, signal); 915 signal = do_notify_parent(tsk, signal);
916 916
917 tsk->exit_state = signal < 0 ? EXIT_DEAD : EXIT_ZOMBIE; 917 tsk->exit_state = signal == DEATH_REAP ? EXIT_DEAD : EXIT_ZOMBIE;
918 918
919 /* mt-exec, de_thread() is waiting for us */ 919 /* mt-exec, de_thread() is waiting for us */
920 if (thread_group_leader(tsk) && 920 if (thread_group_leader(tsk) &&
@@ -927,7 +927,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
927 tracehook_report_death(tsk, signal, cookie, group_dead); 927 tracehook_report_death(tsk, signal, cookie, group_dead);
928 928
929 /* If the process is dead, release it - nobody will wait for it */ 929 /* If the process is dead, release it - nobody will wait for it */
930 if (signal < 0) 930 if (signal == DEATH_REAP)
931 release_task(tsk); 931 release_task(tsk);
932} 932}
933 933