summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-event
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-12 21:29:01 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-12 21:30:15 +0100
commit32c1f5a57998f2a9e1992af006b83e39e3155830 (patch)
treeeea5c491a248765d1eb1ab5de6d4baf46374295d /src/libsystemd/sd-event
parent736ffecc9cf58a0d2c5f147a1f56f2c3532c10ce (diff)
time-util: map ALARM clockids to non-ALARM clockids in now()
Fixes: #2597
Diffstat (limited to 'src/libsystemd/sd-event')
-rw-r--r--src/libsystemd/sd-event/sd-event.c6
1 files changed, 5 insertions, 1 deletions
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;