lkml.org 
[lkml]   [2011]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] signal: sys_pause() should check signal_pending()
ERESTART* is always wrong without TIF_SIGPENDING. Teach sys_pause()
to handle the spurious wakeup correctly.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---

kernel/signal.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- sigprocmask/kernel/signal.c~pause_ck_signal_pending 2011-05-23 18:09:49.000000000 +0200
+++ sigprocmask/kernel/signal.c 2011-05-23 18:52:24.000000000 +0200
@@ -3023,8 +3023,10 @@ SYSCALL_DEFINE2(signal, int, sig, __sigh

SYSCALL_DEFINE0(pause)
{
- current->state = TASK_INTERRUPTIBLE;
- schedule();
+ while (!signal_pending(current)) {
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ }
return -ERESTARTNOHAND;
}



\
 
 \ /
  Last update: 2011-05-23 19:09    [W:0.051 / U:0.740 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site