Browse Source

Kernel: SIGCONT should unblock a blocked process.

Otherwise we might stay in BlockedSignal state forever. Unblocking just
means that the current syscall may fail with EINTR.
Andreas Kling 6 years ago
parent
commit
67fc42f64e
1 changed files with 3 additions and 6 deletions
  1. 3 6
      Kernel/Process.cpp

+ 3 - 6
Kernel/Process.cpp

@@ -868,11 +868,8 @@ ShouldUnblockProcess Process::dispatch_signal(byte signal)
         return ShouldUnblockProcess::No;
         return ShouldUnblockProcess::No;
     }
     }
 
 
-    bool did_continue_stopped_process = false;
-    if (signal == SIGCONT && state() == Stopped) {
+    if (signal == SIGCONT && state() == Stopped)
         set_state(Runnable);
         set_state(Runnable);
-        did_continue_stopped_process = true;
-    }
 
 
     auto handler_laddr = action.handler_or_sigaction;
     auto handler_laddr = action.handler_or_sigaction;
     if (handler_laddr.is_null()) {
     if (handler_laddr.is_null()) {
@@ -880,14 +877,14 @@ ShouldUnblockProcess Process::dispatch_signal(byte signal)
         case DefaultSignalAction::Stop:
         case DefaultSignalAction::Stop:
             set_state(Stopped);
             set_state(Stopped);
             return ShouldUnblockProcess::No;
             return ShouldUnblockProcess::No;
-        case DefaultSignalAction::Continue:
-            return did_continue_stopped_process ? ShouldUnblockProcess::Yes : ShouldUnblockProcess::No;
         case DefaultSignalAction::DumpCore:
         case DefaultSignalAction::DumpCore:
         case DefaultSignalAction::Terminate:
         case DefaultSignalAction::Terminate:
             terminate_due_to_signal(signal);
             terminate_due_to_signal(signal);
             return ShouldUnblockProcess::No;
             return ShouldUnblockProcess::No;
         case DefaultSignalAction::Ignore:
         case DefaultSignalAction::Ignore:
             return ShouldUnblockProcess::No;
             return ShouldUnblockProcess::No;
+        case DefaultSignalAction::Continue:
+            return ShouldUnblockProcess::Yes;
         }
         }
         ASSERT_NOT_REACHED();
         ASSERT_NOT_REACHED();
     }
     }