From 8244b35b23be9c37e1fe7c7176da362b55a300a1 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Wed, 28 May 2025 12:17:58 -0400 Subject: [PATCH] Use CLOCK_*_FAST when CLOCK_*_COARSE is undefined On DragonflyBSD, the *_COARSE constants are not available however values for *_FAST are available. This patch fixes the macro logic and uses fast clocks when coarse clocks are not present. --- blink/xlat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blink/xlat.c b/blink/xlat.c index 37f82e8f6..ada70fdf9 100644 --- a/blink/xlat.c +++ b/blink/xlat.c @@ -765,12 +765,12 @@ int XlatClock(int x, clock_t *clock) { #ifdef CLOCK_REALTIME_COARSE CASE(CLOCK_REALTIME_COARSE_LINUX, res = CLOCK_REALTIME_COARSE); #elif defined(CLOCK_REALTIME_FAST) - CASE(CLOCK_REALTIME_FAST_LINUX, res = CLOCK_REALTIME_FAST); + CASE(CLOCK_REALTIME_COARSE_LINUX, res = CLOCK_REALTIME_FAST); #endif #ifdef CLOCK_MONOTONIC_COARSE CASE(CLOCK_MONOTONIC_COARSE_LINUX, res = CLOCK_MONOTONIC_COARSE); -#elif defined(CLOCK_REALTIME_FAST) - CASE(CLOCK_MONOTONIC_FAST_LINUX, res = CLOCK_MONOTONIC_FAST); +#elif defined(CLOCK_MONOTONIC_FAST) + CASE(CLOCK_MONOTONIC_COARSE_LINUX, res = CLOCK_MONOTONIC_FAST); #endif #ifdef CLOCK_MONOTONIC_RAW CASE(CLOCK_MONOTONIC_RAW_LINUX, res = CLOCK_MONOTONIC_RAW);