[OpenWrt-Devel] [PATCH] netifd: fix compilation with musl 1.2.0
Rosen Penev
rosenp at gmail.com
Wed Mar 25 19:00:03 EDT 2020
Switched to the plain function instead of the now gone syscall.
Added an rt link flag to fix compilation with glibc.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
v2: switch to function
CMakeLists.txt | 2 +-
system-linux.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6203aa..964ea8c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ SET(SOURCES
SET(LIBS
- ubox ubus uci json-c blobmsg_json)
+ rt ubox ubus uci json-c blobmsg_json)
IF (NOT DEFINED LIBNL_LIBS)
FIND_LIBRARY(libnl NAMES libnl-3 libnl nl-3 nl)
diff --git a/system-linux.c b/system-linux.c
index d533be8..d36d287 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -2421,7 +2421,7 @@ time_t system_get_rtime(void)
struct timespec ts;
struct timeval tv;
- if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts) == 0)
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
return ts.tv_sec;
if (gettimeofday(&tv, NULL) == 0)
--
2.25.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list