diff options
author | Oleg Nesterov <oleg@redhat.com> | 2011-06-22 17:08:18 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2011-06-27 14:30:08 -0400 |
commit | 53c8f9f199b239668e6b1a907735ee323a0d1ccd (patch) | |
tree | 785afb9c72a2df27cd6802cf311df18711c59b76 /kernel/signal.c | |
parent | 06d984737bac0545fe20bb5447ee488b95adb531 (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/signal.c')
-rw-r--r-- | kernel/signal.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 1550aee34f42..d52e82cd62bb 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1577,15 +1577,15 @@ ret: | |||
1577 | * Let a parent know about the death of a child. | 1577 | * Let a parent know about the death of a child. |
1578 | * For a stopped/continued status change, use do_notify_parent_cldstop instead. | 1578 | * For a stopped/continued status change, use do_notify_parent_cldstop instead. |
1579 | * | 1579 | * |
1580 | * Returns -1 if our parent ignored us and so we've switched to | 1580 | * Returns true if our parent ignored us and so we've switched to |
1581 | * self-reaping, or else @sig. | 1581 | * self-reaping. |
1582 | */ | 1582 | */ |
1583 | int do_notify_parent(struct task_struct *tsk, int sig) | 1583 | bool do_notify_parent(struct task_struct *tsk, int sig) |
1584 | { | 1584 | { |
1585 | struct siginfo info; | 1585 | struct siginfo info; |
1586 | unsigned long flags; | 1586 | unsigned long flags; |
1587 | struct sighand_struct *psig; | 1587 | struct sighand_struct *psig; |
1588 | int ret = sig; | 1588 | bool autoreap = false; |
1589 | 1589 | ||
1590 | BUG_ON(sig == -1); | 1590 | BUG_ON(sig == -1); |
1591 | 1591 | ||
@@ -1649,16 +1649,17 @@ int do_notify_parent(struct task_struct *tsk, int sig) | |||
1649 | * is implementation-defined: we do (if you don't want | 1649 | * is implementation-defined: we do (if you don't want |
1650 | * it, just use SIG_IGN instead). | 1650 | * it, just use SIG_IGN instead). |
1651 | */ | 1651 | */ |
1652 | ret = tsk->exit_signal = -1; | 1652 | autoreap = true; |
1653 | tsk->exit_signal = -1; | ||
1653 | if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN) | 1654 | if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN) |
1654 | sig = -1; | 1655 | sig = 0; |
1655 | } | 1656 | } |
1656 | if (valid_signal(sig) && sig > 0) | 1657 | if (valid_signal(sig) && sig) |
1657 | __group_send_sig_info(sig, &info, tsk->parent); | 1658 | __group_send_sig_info(sig, &info, tsk->parent); |
1658 | __wake_up_parent(tsk, tsk->parent); | 1659 | __wake_up_parent(tsk, tsk->parent); |
1659 | spin_unlock_irqrestore(&psig->siglock, flags); | 1660 | spin_unlock_irqrestore(&psig->siglock, flags); |
1660 | 1661 | ||
1661 | return ret; | 1662 | return autoreap; |
1662 | } | 1663 | } |
1663 | 1664 | ||
1664 | /** | 1665 | /** |