]> git.hungrycats.org Git - linux/commitdiff
[PATCH] PPC32: cancel syscall restart on signal delivery
authorPaul Mackerras <paulus@samba.org>
Fri, 14 Nov 2003 08:12:24 +0000 (00:12 -0800)
committerPaul Mackerras <paulus@samba.org>
Fri, 14 Nov 2003 08:12:24 +0000 (00:12 -0800)
This patch ensures that the PPC kernel cancels any pending restarted
system call when it delivers a signal.  This is the PPC counterpart of
the change that has recently gone into i386 and other architectures.

arch/ppc/kernel/signal.c

index 4f2be30b038a101736922a0970c3e64713401cad..8d7229485c6529efa391ef3123f09fc19cc5db5d 100644 (file)
@@ -569,10 +569,6 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
                        regs->result = -EINTR;
                        regs->gpr[3] = EINTR;
                        /* note that the cr0.SO bit is already set */
-                       /* clear any restart function that was set */
-                       if (ret == ERESTART_RESTARTBLOCK)
-                               current_thread_info()->restart_block.fn
-                                       = do_no_restart_syscall;
                } else {
                        regs->nip -= 4; /* Back up & retry system call */
                        regs->result = 0;
@@ -587,6 +583,9 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
        if (signr == 0)
                return 0;               /* no signals delivered */
 
+       /* Always make any pending restarted system calls return -EINTR */
+       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
        if ((ka->sa.sa_flags & SA_ONSTACK) && current->sas_ss_size
            && !on_sig_stack(regs->gpr[1]))
                newsp = current->sas_ss_sp + current->sas_ss_size;