Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/odhcp6c.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-03-26 02:15:25 +0300
committerHans Dedecker <dedeckeh@gmail.com>2020-03-26 22:49:13 +0300
commit49305e6847efa43e008d0bebdc176e1833120947 (patch)
treec3a36c55c4dedd05a553bc0256f45e92bfd33da1
parente199804b602a48eb69f0752584c0ad28495b82ad (diff)
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 <rosenp@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r--src/odhcp6c.c5
1 files 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;
}