diff options
-rw-r--r-- | kernel/signal.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 678bffa437c1..3fca710a5cd7 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1591,10 +1591,10 @@ static int sigkill_pending(struct task_struct *tsk) | |||
1591 | * That makes it a way to test a stopped process for | 1591 | * That makes it a way to test a stopped process for |
1592 | * being ptrace-stopped vs being job-control-stopped. | 1592 | * being ptrace-stopped vs being job-control-stopped. |
1593 | * | 1593 | * |
1594 | * If we actually decide not to stop at all because the tracer is gone, | 1594 | * If we actually decide not to stop at all because the tracer |
1595 | * we leave nostop_code in current->exit_code. | 1595 | * is gone, we keep current->exit_code unless clear_code. |
1596 | */ | 1596 | */ |
1597 | static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info) | 1597 | static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info) |
1598 | { | 1598 | { |
1599 | int killed = 0; | 1599 | int killed = 0; |
1600 | 1600 | ||
@@ -1641,7 +1641,8 @@ static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info) | |||
1641 | * Don't drop the lock yet, another tracer may come. | 1641 | * Don't drop the lock yet, another tracer may come. |
1642 | */ | 1642 | */ |
1643 | __set_current_state(TASK_RUNNING); | 1643 | __set_current_state(TASK_RUNNING); |
1644 | current->exit_code = nostop_code; | 1644 | if (clear_code) |
1645 | current->exit_code = 0; | ||
1645 | read_unlock(&tasklist_lock); | 1646 | read_unlock(&tasklist_lock); |
1646 | } | 1647 | } |
1647 | 1648 | ||
@@ -1675,7 +1676,7 @@ void ptrace_notify(int exit_code) | |||
1675 | 1676 | ||
1676 | /* Let the debugger run. */ | 1677 | /* Let the debugger run. */ |
1677 | spin_lock_irq(¤t->sighand->siglock); | 1678 | spin_lock_irq(¤t->sighand->siglock); |
1678 | ptrace_stop(exit_code, 0, &info); | 1679 | ptrace_stop(exit_code, 1, &info); |
1679 | spin_unlock_irq(¤t->sighand->siglock); | 1680 | spin_unlock_irq(¤t->sighand->siglock); |
1680 | } | 1681 | } |
1681 | 1682 | ||
@@ -1782,7 +1783,7 @@ relock: | |||
1782 | ptrace_signal_deliver(regs, cookie); | 1783 | ptrace_signal_deliver(regs, cookie); |
1783 | 1784 | ||
1784 | /* Let the debugger run. */ | 1785 | /* Let the debugger run. */ |
1785 | ptrace_stop(signr, signr, info); | 1786 | ptrace_stop(signr, 0, info); |
1786 | 1787 | ||
1787 | /* We're back. Did the debugger cancel the sig? */ | 1788 | /* We're back. Did the debugger cancel the sig? */ |
1788 | signr = current->exit_code; | 1789 | signr = current->exit_code; |