summaryrefslogtreecommitdiff
path: root/src/core/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/timer.c')
-rw-r--r--src/core/timer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/timer.c b/src/core/timer.c
index 8ed0291ee6..95416f3e74 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -399,7 +399,12 @@ static void timer_enter_waiting(Timer *t, bool initial) {
r = sd_event_source_set_enabled(t->monotonic_event_source, SD_EVENT_ONESHOT);
} else
- r = sd_event_add_monotonic(UNIT(t)->manager->event, &t->monotonic_event_source, t->next_elapse_monotonic, t->accuracy_usec, timer_dispatch, t);
+ r = sd_event_add_time(
+ UNIT(t)->manager->event,
+ &t->monotonic_event_source,
+ CLOCK_MONOTONIC,
+ t->next_elapse_monotonic, t->accuracy_usec,
+ timer_dispatch, t);
if (r < 0)
goto fail;
@@ -421,7 +426,12 @@ static void timer_enter_waiting(Timer *t, bool initial) {
r = sd_event_source_set_enabled(t->realtime_event_source, SD_EVENT_ONESHOT);
} else
- r = sd_event_add_realtime(UNIT(t)->manager->event, &t->realtime_event_source, t->next_elapse_realtime, t->accuracy_usec, timer_dispatch, t);
+ r = sd_event_add_time(
+ UNIT(t)->manager->event,
+ &t->realtime_event_source,
+ CLOCK_REALTIME,
+ t->next_elapse_realtime, t->accuracy_usec,
+ timer_dispatch, t);
if (r < 0)
goto fail;