summaryrefslogtreecommitdiff
path: root/src/core/job.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/job.c
parentf66eeb6bb636f8061bf45e6e8e24761e87510800 (diff)
sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/job.c b/src/core/job.c
index 8e98bd93ab..35a9de6ee3 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -873,7 +873,12 @@ int job_start_timer(Job *j) {
if (j->unit->job_timeout <= 0)
return 0;
- r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j);
+ r = sd_event_add_time(
+ j->manager->event,
+ &j->timer_event_source,
+ CLOCK_MONOTONIC,
+ j->begin_usec + j->unit->job_timeout, 0,
+ job_dispatch_timer, j);
if (r < 0)
return r;
@@ -1061,7 +1066,12 @@ int job_coldplug(Job *j) {
if (j->timer_event_source)
j->timer_event_source = sd_event_source_unref(j->timer_event_source);
- r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j);
+ r = sd_event_add_time(
+ j->manager->event,
+ &j->timer_event_source,
+ CLOCK_MONOTONIC,
+ j->begin_usec + j->unit->job_timeout, 0,
+ job_dispatch_timer, j);
if (r < 0)
log_debug("Failed to restart timeout for job: %s", strerror(-r));