|
@@ -30,9 +30,7 @@ KResultOr<FlatPtr> Process::sys$alarm(unsigned seconds)
|
|
auto deadline = TimeManagement::the().current_time(CLOCK_REALTIME_COARSE);
|
|
auto deadline = TimeManagement::the().current_time(CLOCK_REALTIME_COARSE);
|
|
deadline = deadline + Time::from_seconds(seconds);
|
|
deadline = deadline + Time::from_seconds(seconds);
|
|
if (!m_alarm_timer) {
|
|
if (!m_alarm_timer) {
|
|
- m_alarm_timer = adopt_ref_if_nonnull(new (nothrow) Timer());
|
|
|
|
- if (!m_alarm_timer)
|
|
|
|
- return ENOMEM;
|
|
|
|
|
|
+ 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);
|
|
[[maybe_unused]] auto rc = send_signal(SIGALRM, nullptr);
|