From 49305e6847efa43e008d0bebdc176e1833120947 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 25 Mar 2020 16:15:25 -0700 Subject: [PATCH] odhcp6c: fix compilation with musl 1.2.0 SYS_clock_gettime is gone with musl 1.2.0. Switch to using the normal function. This was done back in the day when uClibc was used when librt was separate. Removed struct initialization since it gets written to right after. Signed-off-by: Rosen Penev Signed-off-by: Hans Dedecker --- src/odhcp6c.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 19a86f2..dbe15ff 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -639,8 +639,9 @@ static int usage(void) // Don't want to pull-in librt and libpthread just for a monotonic clock... uint64_t odhcp6c_get_milli_time(void) { - struct timespec t = {0, 0}; - syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &t); + struct timespec t; + + clock_gettime(CLOCK_MONOTONIC, &t); return ((uint64_t)t.tv_sec) * 1000 + ((uint64_t)t.tv_nsec) / 1000000; } -- 2.30.2