From 32c1f5a57998f2a9e1992af006b83e39e3155830 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Feb 2016 21:29:01 +0100 Subject: time-util: map ALARM clockids to non-ALARM clockids in now() Fixes: #2597 --- src/libsystemd/sd-event/sd-event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libsystemd') diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index deef6ba9d3..2b46a1ff06 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -2780,9 +2780,13 @@ _public_ int sd_event_now(sd_event *e, clockid_t clock, uint64_t *usec) { *usec = e->timestamp.monotonic; break; - default: + case CLOCK_BOOTTIME: + case CLOCK_BOOTTIME_ALARM: *usec = e->timestamp_boottime; break; + + default: + assert_not_reached("Unknown clock?"); } return 0; -- cgit v1.2.3-54-g00ecf