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.
This commit is contained in:
Andreas Kling 2019-03-04 11:25:24 +01:00
parent d932c03843
commit 67fc42f64e
Notes: sideshowbarker 2024-07-19 15:33:12 +09:00

View file

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