chiark / gitweb /
tree-wide: fall back to now(CLOCK_MONOTONIC) if CLOCK_BOOTTIME unsupported (#3037)
authorLubomir Rintel <lkundrak@v3.sk>
Mon, 18 Apr 2016 01:45:42 +0000 (03:45 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:12:57 +0000 (10:12 +0200)
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 elogind/src/basic/time-util.c:70, function now(). Aborting.

src/libelogind/sd-event/sd-event.c

index 34d91d8444ab6d36fe3d5ac1e3733443ed605af7..52ecb8701bb233fd2e09bb163fd7221be098d73f 100644 (file)
@@ -2547,7 +2547,7 @@ _public_ int sd_event_wait(sd_event *e, uint64_t timeout) {
         }
 
         dual_timestamp_get(&e->timestamp);
-        e->timestamp_boottime = now(CLOCK_BOOTTIME);
+        e->timestamp_boottime = now(clock_boottime_or_monotonic());
 
         for (i = 0; i < m; i++) {