+ if (t->monotonic_event_source) {
+ r = sd_event_source_set_time(t->monotonic_event_source, t->next_elapse_monotonic);
+ if (r < 0)
+ goto fail;
+
+ r = sd_event_source_set_enabled(t->monotonic_event_source, SD_EVENT_ONESHOT);
+ } else
+ r = sd_event_add_monotonic(UNIT(t)->manager->event, t->next_elapse_monotonic, t->accuracy_usec, timer_dispatch, t, &t->monotonic_event_source);
+
+ if (r < 0)
+ goto fail;
+
+ } else if (t->monotonic_event_source) {
+ r = sd_event_source_set_enabled(t->monotonic_event_source, SD_EVENT_OFF);
+
+ if (r < 0)
+ goto fail;
+ }
+
+ if (found_realtime) {
+ char buf[FORMAT_TIMESTAMP_MAX];
+ log_debug_unit(UNIT(t)->id,
+ "%s: Realtime timer elapses at %s.",
+ UNIT(t)->id,
+ format_timestamp(buf, sizeof(buf), t->next_elapse_realtime));
+
+ if (t->realtime_event_source) {
+ r = sd_event_source_set_time(t->realtime_event_source, t->next_elapse_realtime);
+ if (r < 0)
+ goto fail;
+
+ r = sd_event_source_set_enabled(t->realtime_event_source, SD_EVENT_ONESHOT);
+ } else
+ r = sd_event_add_realtime(UNIT(t)->manager->event, t->next_elapse_realtime, t->accuracy_usec, timer_dispatch, t, &t->realtime_event_source);
+
+ if (r < 0)
+ goto fail;
+
+ } else if (t->realtime_event_source) {
+ r = sd_event_source_set_enabled(t->realtime_event_source, SD_EVENT_OFF);
+
+ if (r < 0)
+ goto fail;
+ }