vserver 1.9.3
[linux-2.6.git] / arch / cris / arch-v10 / kernel / signal.c
index 6698054..19f93fe 100644 (file)
@@ -180,6 +180,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
        unsigned int err = 0;
        unsigned long old_usp;
 
+        /* Always make any pending restarted system calls return -EINTR */
+       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
        /* restore the regs from &sc->regs (same as sc, since regs is first)
         * (sc is already checked for VERIFY_READ since the sigframe was
         *  checked in sys_sigreturn previously)
@@ -406,9 +409,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
        return;
 
 give_sigsegv:
-       if (sig == SIGSEGV)
-               ka->sa.sa_handler = SIG_DFL;
-       force_sig(SIGSEGV, current);
+       force_sigsegv(sig, current);
 }
 
 static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
@@ -472,9 +473,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        return;
 
 give_sigsegv:
-       if (sig == SIGSEGV)
-               ka->sa.sa_handler = SIG_DFL;
-       force_sig(SIGSEGV, current);
+       force_sigsegv(sig, current);
 }
 
 /*
@@ -492,7 +491,6 @@ handle_signal(int canrestart, unsigned long sig,
                /* If so, check system call restarting.. */
                switch (regs->r10) {
                        case -ERESTART_RESTARTBLOCK:
-                               current_thread_info()->restart_block.fn = do_no_restart_syscall;
                        case -ERESTARTNOHAND:
                                /* ERESTARTNOHAND means that the syscall should only be
                                   restarted if there was no handler for the signal, and since