aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2011-06-22 17:08:18 -0400
committerOleg Nesterov <oleg@redhat.com>2011-06-27 14:30:08 -0400
commit53c8f9f199b239668e6b1a907735ee323a0d1ccd (patch)
tree785afb9c72a2df27cd6802cf311df18711c59b76 /kernel/exit.c
parent06d984737bac0545fe20bb5447ee488b95adb531 (diff)
make do_notify_parent() return bool
- change do_notify_parent() to return a boolean, true if the task should be reaped because its parent ignores SIGCHLD. - update the only caller which checks the returned value, exit_notify(). This temporary uglifies exit_notify() even more, will be cleanuped by the next change. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index d49134a7f250..34d135f4fccc 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -820,6 +820,7 @@ static void forget_original_parent(struct task_struct *father)
820static void exit_notify(struct task_struct *tsk, int group_dead) 820static void exit_notify(struct task_struct *tsk, int group_dead)
821{ 821{
822 int signal; 822 int signal;
823 bool autoreap;
823 void *cookie; 824 void *cookie;
824 825
825 /* 826 /*
@@ -858,9 +859,11 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
858 859
859 signal = tracehook_notify_death(tsk, &cookie, group_dead); 860 signal = tracehook_notify_death(tsk, &cookie, group_dead);
860 if (signal >= 0) 861 if (signal >= 0)
861 signal = do_notify_parent(tsk, signal); 862 autoreap = do_notify_parent(tsk, signal);
863 else
864 autoreap = (signal == DEATH_REAP);
862 865
863 tsk->exit_state = signal == DEATH_REAP ? EXIT_DEAD : EXIT_ZOMBIE; 866 tsk->exit_state = autoreap ? EXIT_DEAD : EXIT_ZOMBIE;
864 867
865 /* mt-exec, de_thread() is waiting for group leader */ 868 /* mt-exec, de_thread() is waiting for group leader */
866 if (unlikely(tsk->signal->notify_count < 0)) 869 if (unlikely(tsk->signal->notify_count < 0))
@@ -868,7 +871,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
868 write_unlock_irq(&tasklist_lock); 871 write_unlock_irq(&tasklist_lock);
869 872
870 /* If the process is dead, release it - nobody will wait for it */ 873 /* If the process is dead, release it - nobody will wait for it */
871 if (signal == DEATH_REAP) 874 if (autoreap)
872 release_task(tsk); 875 release_task(tsk);
873} 876}
874 877