]> git.hungrycats.org Git - linux/commitdiff
Hand merge
authorDaniel Jacobowitz <drow@nevyn.them.org>
Fri, 7 Feb 2003 11:39:09 +0000 (06:39 -0500)
committerDaniel Jacobowitz <drow@nevyn.them.org>
Fri, 7 Feb 2003 11:39:09 +0000 (06:39 -0500)
1  2 
include/linux/sched.h
kernel/exit.c
kernel/fork.c
kernel/signal.c

Simple merge
diff --cc kernel/exit.c
index febad08ae9ef531706cffe074d010aaa07c785cd,de4239772f8c0fe1c96e649353b87095c7389055..fbc00cfae0304345b5e5ce41a2651baeb9b98587
@@@ -594,14 -581,14 +605,14 @@@ static void exit_notify(struct task_str
         * 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
@@@ -661,6 -656,10 +680,9 @@@ NORET_TYPE void do_exit(long code
  
        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);
  
diff --cc kernel/fork.c
Simple merge
diff --cc kernel/signal.c
Simple merge