summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-04-18 03:45:42 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-17 21:45:42 -0400
commit6f7202cfd512d18f561af6708fe0823c9545f674 (patch)
treea64a51fad048ea0cb2663b0c27b531575751f3b0 /src/core
parent746af6e0b5aaed999be912e48505d3edc2cf874a (diff)
tree-wide: fall back to now(CLOCK_MONOTONIC) if CLOCK_BOOTTIME unsupported (#3037)
It was added in 2.6.39, and causes an assertion to fail when running in mock hosted on 2.6.32-based RHEL-6: Assertion 'clock_gettime(map_clock_id(clock_id), &ts) == 0' failed at systemd/src/basic/time-util.c:70, function now(). Aborting.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/dbus-timer.c2
-rw-r--r--src/core/timer.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
index bc121b83a2..a0e61b023e 100644
--- a/src/core/dbus-timer.c
+++ b/src/core/dbus-timer.c
@@ -156,7 +156,7 @@ static int property_get_next_elapse_monotonic(
usec_t a, b;
a = now(CLOCK_MONOTONIC);
- b = now(CLOCK_BOOTTIME);
+ b = now(clock_boottime_or_monotonic());
if (t->next_elapse_monotonic_or_boottime + a > b)
x = t->next_elapse_monotonic_or_boottime + a - b;
diff --git a/src/core/timer.c b/src/core/timer.c
index a51a67ea11..b286b714fa 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -320,7 +320,7 @@ static usec_t monotonic_to_boottime(usec_t t) {
if (t <= 0)
return 0;
- a = now(CLOCK_BOOTTIME);
+ a = now(clock_boottime_or_monotonic());
b = now(CLOCK_MONOTONIC);
if (t + a > b)