summaryrefslogtreecommitdiff
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 0523eb305c17..d2d7c72f1e81 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -694,10 +694,8 @@ static void exit_notify(struct task_struct *tsk)
* only has special meaning to our real parent.
*/
if (tsk->exit_signal != -1) {
- if (tsk->parent == tsk->real_parent)
- do_notify_parent(tsk, tsk->exit_signal);
- else
- do_notify_parent(tsk, SIGCHLD);
+ int signal = tsk->parent == tsk->real_parent ? tsk->exit_signal : SIGCHLD;
+ do_notify_parent(tsk, signal);
}
tsk->state = TASK_ZOMBIE;
@@ -731,8 +729,10 @@ NORET_TYPE void do_exit(long code)
profile_exit_task(tsk);
- if (unlikely(current->ptrace & PT_TRACE_EXIT))
+ if (unlikely(current->ptrace & PT_TRACE_EXIT)) {
+ current->ptrace_message = code;
ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP);
+ }
acct_process(code);
__exit_mm(tsk);