ntpclient: fix compilation with newer kernels

glibc needs an extra header included.

Also cast time values to 64-bit in preparation for 64-bit time_t for
32-bit platforms.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-04-07 19:51:31 -07:00
parent 49d102503a
commit 1253beb2fe
3 changed files with 54 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
--- a/ntpclient.c
+++ b/ntpclient.c
@@ -42,6 +42,9 @@
#include <errno.h>
#ifdef PRECISION_SIOCGSTAMP
#include <sys/ioctl.h>
+#ifdef __GLIBC__
+#include <linux/sockios.h>
+#endif
#endif
#ifdef USE_OBSOLETE_GETTIMEOFDAY
#include <sys/time.h>