Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139688
b: refs/heads/master
c: 6d69cb8
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 3, 2009
1 parent 0488aae commit 9de8d7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95c3eb76dc07fd81289888ffc42948196b34b444
refs/heads/master: 6d69cb87f05eef3b02370b2f7bae608ad2301a00
25 changes: 8 additions & 17 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,19 +732,15 @@ static void exit_mm(struct task_struct * tsk)
}

/*
* Return nonzero if @parent's children should reap themselves.
*
* Called with write_lock_irq(&tasklist_lock) held.
* Called with irqs disabled, returns true if childs should reap themselves.
*/
static int ignoring_children(struct task_struct *parent)
static int ignoring_children(struct sighand_struct *sigh)
{
int ret;
struct sighand_struct *psig = parent->sighand;
unsigned long flags;
spin_lock_irqsave(&psig->siglock, flags);
ret = (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN ||
(psig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDWAIT));
spin_unlock_irqrestore(&psig->siglock, flags);
spin_lock(&sigh->siglock);
ret = (sigh->action[SIGCHLD-1].sa.sa_handler == SIG_IGN) ||
(sigh->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDWAIT);
spin_unlock(&sigh->siglock);
return ret;
}

Expand All @@ -757,7 +753,6 @@ static int ignoring_children(struct task_struct *parent)
static void ptrace_exit(struct task_struct *parent, struct list_head *dead)
{
struct task_struct *p, *n;
int ign = -1;

list_for_each_entry_safe(p, n, &parent->ptraced, ptrace_entry) {
__ptrace_unlink(p);
Expand All @@ -779,12 +774,8 @@ static void ptrace_exit(struct task_struct *parent, struct list_head *dead)
if (!task_detached(p) && thread_group_empty(p)) {
if (!same_thread_group(p->real_parent, parent))
do_notify_parent(p, p->exit_signal);
else {
if (ign < 0)
ign = ignoring_children(parent);
if (ign)
p->exit_signal = -1;
}
else if (ignoring_children(parent->sighand))
p->exit_signal = -1;
}

if (task_detached(p)) {
Expand Down

0 comments on commit 9de8d7e

Please sign in to comment.