From ba4e0427e955a648e24f6506d0cb92857c84b85d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 28 Mar 2022 16:41:10 +0200 Subject: time-util: assume CLOCK_BOOTTIME always exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's raise our supported baseline a bit: CLOCK_BOOTTIME started to work with timerfd in kernel 3.15 (i.e. back in 2014), let's require support for it now. This will raise our baseline only modestly from 3.13 → 3.15. --- src/udev/udev-ctrl.c | 2 +- src/udev/udevd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/udev') diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index 45e45162ae..4913d0262b 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -356,7 +356,7 @@ int udev_ctrl_wait(UdevCtrl *uctrl, usec_t timeout) { if (timeout != USEC_INFINITY) { r = sd_event_add_time_relative( - uctrl->event, &source_timeout, clock_boottime_or_monotonic(), + uctrl->event, &source_timeout, CLOCK_BOOTTIME, timeout, 0, NULL, INT_TO_PTR(-ETIMEDOUT)); if (r < 0) diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 4d03f82fae..67d7733be2 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -807,7 +807,7 @@ static int event_is_blocked(Event *event) { if (event->retry_again_next_usec > 0) { usec_t now_usec; - r = sd_event_now(event->manager->event, clock_boottime_or_monotonic(), &now_usec); + r = sd_event_now(event->manager->event, CLOCK_BOOTTIME, &now_usec); if (r < 0) return r; @@ -1013,7 +1013,7 @@ static int event_requeue(Event *event) { event->timeout_event = sd_event_source_disable_unref(event->timeout_event); /* add a short delay to suppress busy loop */ - r = sd_event_now(event->manager->event, clock_boottime_or_monotonic(), &now_usec); + r = sd_event_now(event->manager->event, CLOCK_BOOTTIME, &now_usec); if (r < 0) return log_device_warning_errno(event->dev, r, "Failed to get current time, " -- cgit v1.2.3