Skip to content

Commit

Permalink
Kernel: Validate the sys$alarm signal send always succeeds
Browse files Browse the repository at this point in the history
Previously we were ignoring this return code, instead use MUST(..)
to make sure it always succeeds.
  • Loading branch information
bgianfo committed Aug 10, 2022
1 parent 00936e1 commit 09d5360
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/Syscalls/alarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 09d5360

Please sign in to comment.