Commit 88317175 authored by Roland McGrath's avatar Roland McGrath Committed by Trond Myklebust

[PATCH] Ctrl-C-ing strace

This patch fix es the signals vs strace problem.  The signal code
assumes that anybody who is TAK_STOPPED will check signals before
resuming, and the ptrace paths didn't do that.
parent 8da1973b
......@@ -530,11 +530,9 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit)
return;
/* the 0x80 provides a way for the tracing parent to distinguish
between a syscall stop and SIGTRAP delivery */
current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0);
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
schedule();
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0));
/*
* this isn't the same as continuing with a signal, but it will do
* for normal use. strace only continues with a signal if the
......
......@@ -351,4 +351,9 @@ void ptrace_notify(int exit_code)
set_current_state(TASK_STOPPED);
notify_parent(current, SIGCHLD);
schedule();
/*
* Signals sent while we were stopped might set TIF_SIGPENDING.
*/
recalc_sigpending();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment