* is about to become orphaned.
*/
- t = tsk->parent;
- t = current->real_parent;
++ t = tsk->real_parent;
- if ((t->pgrp != current->pgrp) &&
- (t->session == current->session) &&
- will_become_orphaned_pgrp(current->pgrp, current) &&
- has_stopped_jobs(current->pgrp)) {
- __kill_pg_info(SIGHUP, (void *)1, current->pgrp);
- __kill_pg_info(SIGCONT, (void *)1, current->pgrp);
+ if ((t->pgrp != tsk->pgrp) &&
+ (t->session == tsk->session) &&
+ will_become_orphaned_pgrp(tsk->pgrp, tsk) &&
+ has_stopped_jobs(tsk->pgrp)) {
+ __kill_pg_info(SIGHUP, (void *)1, tsk->pgrp);
+ __kill_pg_info(SIGCONT, (void *)1, tsk->pgrp);
}
/* Let father know we died
*
*/
- if (current->exit_signal != SIGCHLD && current->exit_signal != -1 &&
- ( current->parent_exec_id != t->self_exec_id ||
- current->self_exec_id != current->parent_exec_id)
+ if (tsk->exit_signal != SIGCHLD && tsk->exit_signal != -1 &&
+ ( tsk->parent_exec_id != t->self_exec_id ||
+ tsk->self_exec_id != tsk->parent_exec_id)
&& !capable(CAP_KILL))
- current->exit_signal = SIGCHLD;
+ tsk->exit_signal = SIGCHLD;
- if (tsk->exit_signal != -1)
- do_notify_parent(tsk, tsk->exit_signal);
+ /* If something other than our normal parent is ptracing us, then
+ * send it a SIGCHLD instead of honoring exit_signal. exit_signal
+ * only has special meaning to our real parent.
+ */
- if (current->exit_signal != -1) {
- if (current->parent == current->real_parent)
- do_notify_parent(current, current->exit_signal);
++ if (tsk->exit_signal != -1) {
++ if (tsk->parent == tsk->real_parent)
++ do_notify_parent(tsk, tsk->exit_signal);
+ else
- do_notify_parent(current, SIGCHLD);
++ do_notify_parent(tsk, SIGCHLD);
+ }
- current->state = TASK_ZOMBIE;
+ tsk->state = TASK_ZOMBIE;
/*
* No need to unlock IRQs, we'll schedule() immediately
* anyway. In the preemption case this also makes it
profile_exit_task(tsk);
-fake_volatile:
+ if (unlikely(current->ptrace & PT_TRACE_EXIT))
+ ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP);
+
acct_process(code);
__exit_mm(tsk);