Kernel: Validate the sys$alarm signal send always succeeds

Previously we were ignoring this return code, instead use MUST(..)
to make sure it always succeeds.
This commit is contained in:
Brian Gianforcaro 2022-08-09 20:31:29 -07:00
parent 00936e151e
commit 09d5360be3
Notes: sideshowbarker 2024-07-17 08:20:53 +09:00

View file

@ -34,7 +34,7 @@ ErrorOr<FlatPtr> Process::sys$alarm(unsigned seconds)
m_alarm_timer = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Timer));
}
auto timer_was_added = TimerQueue::the().add_timer_without_id(*m_alarm_timer, CLOCK_REALTIME_COARSE, deadline, [this]() {
[[maybe_unused]] auto rc = send_signal(SIGALRM, nullptr);
MUST(send_signal(SIGALRM, nullptr));
});
if (!timer_was_added)
return ENOMEM;