summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-24 02:49:09 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-24 02:58:41 +0100
commit6a0f1f6d5af7c7300d3db7a0ba2b068f8abd222b (patch)
tree37083cf4a7292fc4657372d034475e026693f969 /src/core/service.c
parentf66eeb6bb636f8061bf45e6e8e24761e87510800 (diff)
sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 78a2e06fff..67467b2d6d 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -257,7 +257,12 @@ static void service_start_watchdog(Service *s) {
r = sd_event_source_set_enabled(s->watchdog_event_source, SD_EVENT_ONESHOT);
} else {
- r = sd_event_add_monotonic(UNIT(s)->manager->event, &s->watchdog_event_source, s->watchdog_timestamp.monotonic + s->watchdog_usec, 0, service_dispatch_watchdog, s);
+ r = sd_event_add_time(
+ UNIT(s)->manager->event,
+ &s->watchdog_event_source,
+ CLOCK_MONOTONIC,
+ s->watchdog_timestamp.monotonic + s->watchdog_usec, 0,
+ service_dispatch_watchdog, s);
if (r < 0) {
log_warning_unit(UNIT(s)->id, "%s failed to add watchdog timer: %s", UNIT(s)->id, strerror(-r));
return;
@@ -345,7 +350,12 @@ static int service_arm_timer(Service *s, usec_t usec) {
return sd_event_source_set_enabled(s->timer_event_source, SD_EVENT_ONESHOT);
}
- return sd_event_add_monotonic(UNIT(s)->manager->event, &s->timer_event_source, now(CLOCK_MONOTONIC) + usec, 0, service_dispatch_timer, s);
+ return sd_event_add_time(
+ UNIT(s)->manager->event,
+ &s->timer_event_source,
+ CLOCK_MONOTONIC,
+ now(CLOCK_MONOTONIC) + usec, 0,
+ service_dispatch_timer, s);
}
#ifdef HAVE_SYSV_COMPAT