Преглед изворни кода

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>
Oleg Nesterov пре 14 година
родитељ
комит
d92fcf0552
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      kernel/signal.c

+ 4 - 2
kernel/signal.c

@@ -3023,8 +3023,10 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
 
 SYSCALL_DEFINE0(pause)
 {
-	current->state = TASK_INTERRUPTIBLE;
-	schedule();
+	while (!signal_pending(current)) {
+		current->state = TASK_INTERRUPTIBLE;
+		schedule();
+	}
 	return -ERESTARTNOHAND;
 }