Merge to Fedora kernel-2.6.18-1.2255_FC5-vs2.0.2.2-rc9 patched with stable patch...
[linux-2.6.git] / arch / frv / kernel / ptrace.c
index 44d3df5..fcff819 100644 (file)
@@ -700,11 +700,24 @@ asmlinkage void do_syscall_trace(int leaving)
        if (!test_thread_flag(TIF_SYSCALL_TRACE))
                return;
 
+       if (!(current->ptrace & PT_PTRACED))
+               return;
+
        /* we need to indicate entry or exit to strace */
        if (leaving)
                __frame->__status |= REG__STATUS_SYSC_EXIT;
        else
                __frame->__status |= REG__STATUS_SYSC_ENTRY;
 
-       tracehook_report_syscall(regs, leaving);
+       ptrace_notify(SIGTRAP);
+
+       /*
+        * 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
+        * stopping signal is not SIGTRAP.  -brl
+        */
+       if (current->exit_code) {
+               send_sig(current->exit_code, current, 1);
+               current->exit_code = 0;
+       }
 }