Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84652
b: refs/heads/master
c: 20686a3
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Feb 8, 2008
1 parent 959df5d commit 36d0a23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9cbab8100538efdd93aeae6fc37787d986f2f558
refs/heads/master: 20686a309aa98c518adbbd9b57cdbb1804143deb
13 changes: 7 additions & 6 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,10 +1591,10 @@ static int sigkill_pending(struct task_struct *tsk)
* That makes it a way to test a stopped process for
* being ptrace-stopped vs being job-control-stopped.
*
* If we actually decide not to stop at all because the tracer is gone,
* we leave nostop_code in current->exit_code.
* If we actually decide not to stop at all because the tracer
* is gone, we keep current->exit_code unless clear_code.
*/
static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info)
static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info)
{
int killed = 0;

Expand Down Expand Up @@ -1641,7 +1641,8 @@ static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info)
* Don't drop the lock yet, another tracer may come.
*/
__set_current_state(TASK_RUNNING);
current->exit_code = nostop_code;
if (clear_code)
current->exit_code = 0;
read_unlock(&tasklist_lock);
}

Expand Down Expand Up @@ -1675,7 +1676,7 @@ void ptrace_notify(int exit_code)

/* Let the debugger run. */
spin_lock_irq(&current->sighand->siglock);
ptrace_stop(exit_code, 0, &info);
ptrace_stop(exit_code, 1, &info);
spin_unlock_irq(&current->sighand->siglock);
}

Expand Down Expand Up @@ -1782,7 +1783,7 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
ptrace_signal_deliver(regs, cookie);

/* Let the debugger run. */
ptrace_stop(signr, signr, info);
ptrace_stop(signr, 0, info);

/* We're back. Did the debugger cancel the sig? */
signr = current->exit_code;
Expand Down

0 comments on commit 36d0a23

Please sign in to comment.