Now that utrace-ptrace doesn't use PT_PTRACED, we don't need ifdefs in signal.c, we can filter out ptrace_signal() if we check PT_PTRACED bit.
Again, note that this change in ptrace_signal() is equally correct for upstream. IOW, I am going to make the preparation patch which adds/removes some PT_PTRACED checks for upstream, then utrace-ptrace will only change ptrace.c and nothing outside. --- kernel/signal.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) --- PU/kernel/signal.c~113_REVERT_UTRACE_HACKS_IN_SIGNAL 2009-10-09 13:19:11.000000000 +0200 +++ PU/kernel/signal.c 2009-10-21 20:11:46.000000000 +0200 @@ -1533,8 +1533,6 @@ void do_notify_parent_cldstop(struct tas spin_unlock_irqrestore(&sighand->siglock, flags); } -#ifndef CONFIG_UTRACE_PTRACE - static inline int may_ptrace_stop(void) { if (!likely(task_ptrace(current))) @@ -1675,8 +1673,6 @@ void ptrace_notify(int exit_code) spin_unlock_irq(¤t->sighand->siglock); } -#endif /* !CONFIG_UTRACE_PTRACE */ - /* * This performs the stopping for SIGSTOP and other stop signals. * We have to stop all threads in the thread group. @@ -1750,11 +1746,10 @@ static int do_signal_stop(int signr) return 1; } -#ifndef CONFIG_UTRACE_PTRACE static int ptrace_signal(int signr, siginfo_t *info, struct pt_regs *regs, void *cookie) { - if (!task_ptrace(current)) + if (!(task_ptrace(current) & PT_PTRACED)) return signr; ptrace_signal_deliver(regs, cookie); @@ -1789,13 +1784,6 @@ static int ptrace_signal(int signr, sigi return signr; } -#else -static int ptrace_signal(int signr, siginfo_t *info, - struct pt_regs *regs, void *cookie) -{ - return signr; -} -#endif int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie)