aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index c7397c46ad6d..d0ecea0781f7 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -660,12 +660,23 @@ static int de_thread(struct task_struct *tsk)
660 struct dentry *proc_dentry1, *proc_dentry2; 660 struct dentry *proc_dentry1, *proc_dentry2;
661 unsigned long ptrace; 661 unsigned long ptrace;
662 662
663 leader = current->group_leader;
664 /*
665 * If our leader is the child_reaper become
666 * the child_reaper and resend SIGKILL signal.
667 */
668 if (unlikely(leader == child_reaper)) {
669 write_lock(&tasklist_lock);
670 child_reaper = current;
671 zap_other_threads(current);
672 write_unlock(&tasklist_lock);
673 }
674
663 /* 675 /*
664 * Wait for the thread group leader to be a zombie. 676 * Wait for the thread group leader to be a zombie.
665 * It should already be zombie at this point, most 677 * It should already be zombie at this point, most
666 * of the time. 678 * of the time.
667 */ 679 */
668 leader = current->group_leader;
669 while (leader->exit_state != EXIT_ZOMBIE) 680 while (leader->exit_state != EXIT_ZOMBIE)
670 yield(); 681 yield();
671 682