]> git.hungrycats.org Git - linux/commitdiff
Hand-merge with Ingo's changes
authorDaniel Jacobowitz <drow@nevyn.them.org>
Thu, 6 Feb 2003 13:07:11 +0000 (08:07 -0500)
committerDaniel Jacobowitz <drow@nevyn.them.org>
Thu, 6 Feb 2003 13:07:11 +0000 (08:07 -0500)
1  2 
include/linux/sched.h
kernel/exit.c
kernel/fork.c
kernel/signal.c

Simple merge
diff --cc kernel/exit.c
index 25281033be8d9e69c07d9e382c3dddec38539074,0846290aeea314452fb713f2b755c00538bfedf6..53318f1056a5d4d4479007fd00d06e6ce7230846
@@@ -951,17 -884,11 +973,17 @@@ repeat
                                retval = p->pid;
                                if (p->real_parent != p->parent) {
                                        write_lock_irq(&tasklist_lock);
 -                                      __ptrace_unlink(p);
 -                                      do_notify_parent(p, p->exit_signal);
 -                                      p->state = TASK_ZOMBIE;
 +                                      /* Double-check with lock held.  */
 +                                      if (p->real_parent != p->parent) {
-                                       __ptrace_unlink(p);
++                                              __ptrace_unlink(p);
 +                                              do_notify_parent(
 +                                                      p, p->exit_signal);
-                                       p->state = TASK_ZOMBIE;
++                                              p->state = TASK_ZOMBIE;
 +                                              p = NULL;
 +                                      }
                                        write_unlock_irq(&tasklist_lock);
 -                              } else
 +                              }
 +                              if (p != NULL)
                                        release_task(p);
                                goto end_wait4;
                        default:
diff --cc kernel/fork.c
Simple merge
diff --cc kernel/signal.c
index 809ea104b63fc5d81a037f857070ac376aa4e47f,b683402178ec8870b3768ca2aa00e5804bb31dab..b773438525f702696f7a30335a9be59f9b703b8a
@@@ -1392,18 -1242,9 +1392,19 @@@ int get_signal_to_deliver(siginfo_t *in
                        break;
  
                if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
 +                      /*
 +                       * If there is a group stop in progress,
 +                       * we must participate in the bookkeeping.
 +                       */
 +                      if (current->sig->group_stop_count > 0) {
 +                              spin_lock_irq(&current->sig->siglock);
 +                              --current->sig->group_stop_count;
 +                              spin_unlock_irq(&current->sig->siglock);
 +                      }
 +
                        /* Let the debugger run.  */
                        current->exit_code = signr;
+                       current->last_siginfo = info;
                        set_current_state(TASK_STOPPED);
                        notify_parent(current, SIGCHLD);
                        schedule();
                                continue;
                        current->exit_code = 0;
  
-                       /* Update the siginfo structure.  Is this good?  */
 -                      /* The debugger continued.  Ignore SIGSTOP.  */
 -                      if (signr == SIGSTOP)
 -                              continue;
 -
+                       /* Update the siginfo structure if the signal has
+                          changed.  If the debugger wanted something
+                          specific in the siginfo structure then it should
+                          have updated *info via PTRACE_SETSIGINFO.  */
                        if (signr != info->si_signo) {
                                info->si_signo = signr;
                                info->si_errno = 0;