mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
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:
parent
00936e151e
commit
09d5360be3
Notes:
sideshowbarker
2024-07-17 08:20:53 +09:00
Author: https://github.com/bgianfo
Commit: 09d5360be3
Pull-request: https://github.com/SerenityOS/serenity/pull/14818
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ ErrorOr<FlatPtr> Process::sys$alarm(unsigned seconds)
|
||||||
m_alarm_timer = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Timer));
|
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]() {
|
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)
|
if (!timer_was_added)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue