diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-06-18 23:33:21 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-06-18 23:33:21 -0400 |
commit | 3aeb884b4ec442719a2d8aa15316415a7412efd8 (patch) | |
tree | bcf69c95107b8296cbe76c0d86ee7cadc05c6019 /arch/sh/kernel/signal.c | |
parent | 5527398218aae85f37552a69fad163fa500c39e4 (diff) |
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 <shaw.carl@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/signal.c')
-rw-r--r-- | 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 fdca038e4b91..e323e299878b 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, | |||
268 | badframe: | 268 | badframe: |
269 | force_sig(SIGSEGV, current); | 269 | force_sig(SIGSEGV, current); |
270 | return 0; | 270 | return 0; |
271 | } | 271 | } |
272 | 272 | ||
273 | /* | 273 | /* |
274 | * Set up a signal frame. | 274 | * Set up a signal frame. |
@@ -489,6 +489,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
489 | if (regs->tra >= 0) { | 489 | if (regs->tra >= 0) { |
490 | /* If so, check system call restarting.. */ | 490 | /* If so, check system call restarting.. */ |
491 | switch (regs->regs[0]) { | 491 | switch (regs->regs[0]) { |
492 | case -ERESTART_RESTARTBLOCK: | ||
492 | case -ERESTARTNOHAND: | 493 | case -ERESTARTNOHAND: |
493 | regs->regs[0] = -EINTR; | 494 | regs->regs[0] = -EINTR; |
494 | break; | 495 | break; |
@@ -584,8 +585,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
584 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 585 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
585 | if (signr > 0) { | 586 | if (signr > 0) { |
586 | /* Whee! Actually deliver the signal. */ | 587 | /* Whee! Actually deliver the signal. */ |
587 | if (handle_signal(signr, &ka, &info, oldset, regs, save_r0) | 588 | if (handle_signal(signr, &ka, &info, oldset, |
588 | == 0) { | 589 | regs, save_r0) == 0) { |
589 | /* a signal was successfully delivered; the saved | 590 | /* a signal was successfully delivered; the saved |
590 | * sigmask will have been stored in the signal frame, | 591 | * sigmask will have been stored in the signal frame, |
591 | * and will be restored by sigreturn, so we can simply | 592 | * and will be restored by sigreturn, so we can simply |