Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3aeb884b4ec442719a2d8aa15316415a7412efd8 Commit: 3aeb884b4ec442719a2d8aa15316415a7412efd8 Parent: 5527398218aae85f37552a69fad163fa500c39e4 Author: Paul Mundt <[EMAIL PROTECTED]> AuthorDate: Tue Jun 19 12:33:21 2007 +0900 Committer: Paul Mundt <[EMAIL PROTECTED]> CommitDate: Tue Jun 19 12:33:21 2007 +0900
sh: Handle -ERESTART_RESTARTBLOCK for restartable syscalls. The current implementation only handles -ERESTARTNOHAND, whereas we also need to handle -ERESTART_RESTARTBLOCK in the handle_signal() case for restartable system calls. As noted by Carl: This fixes the LTP test nanosleep03 - the current kernel causes -ERESTART_RESTARTBLOCK to reach user space rather than the correct -EINTR. Reported-by: Carl Shaw <[EMAIL PROTECTED]> Signed-off-by: Paul Mundt <[EMAIL PROTECTED]> --- arch/sh/kernel/signal.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index fdca038..e323e29 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -268,7 +268,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, badframe: force_sig(SIGSEGV, current); return 0; -} +} /* * Set up a signal frame. @@ -489,6 +489,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, if (regs->tra >= 0) { /* If so, check system call restarting.. */ switch (regs->regs[0]) { + case -ERESTART_RESTARTBLOCK: case -ERESTARTNOHAND: regs->regs[0] = -EINTR; break; @@ -584,8 +585,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ - if (handle_signal(signr, &ka, &info, oldset, regs, save_r0) - == 0) { + if (handle_signal(signr, &ka, &info, oldset, + regs, save_r0) == 0) { /* a signal was successfully delivered; the saved * sigmask will have been stored in the signal frame, * and will be restored by sigreturn, so we can simply - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html