From ee6e39305c55d04e647c294898568ed1d3699638 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 7 Jan 2019 21:31:34 +0000 Subject: include: add indirect monotonic clock id specifier Avoid repeated ifdef checks in code by adding a project specific preprocessor definition. Signed-off-by: Sami Kerola --- lib/monotonic.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/monotonic.c b/lib/monotonic.c index bb58e15d7..96ead1ee0 100644 --- a/lib/monotonic.c +++ b/lib/monotonic.c @@ -52,12 +52,8 @@ int gettime_monotonic(struct timeval *tv) int ret; struct timespec ts; -# ifdef CLOCK_MONOTONIC_RAW /* Linux specific, can't slew */ - if (!(ret = clock_gettime(CLOCK_MONOTONIC_RAW, &ts))) { -# else - if (!(ret = clock_gettime(CLOCK_MONOTONIC, &ts))) { -# endif + if (!(ret = clock_gettime(UL_CLOCK_MONOTONIC, &ts))) { tv->tv_sec = ts.tv_sec; tv->tv_usec = ts.tv_nsec / 1000; } -- cgit v1.2.3-55-g7522