sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too
This commit is contained in:
+12
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user