ntpclient: fixup time patch

Added missing header and added casts.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
pull/11832/head
Rosen Penev 2020-04-10 22:22:14 -07:00
parent 53c48fae15
commit cd79e92885
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
3 changed files with 18 additions and 5 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ntpclient
PKG_VERSION:=2015_365
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient

View File

@ -8,7 +8,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
@@ -143,8 +144,8 @@ int main(int argc, char ** argv)
@@ -143,12 +144,12 @@ int main(int argc, char ** argv)
" precision: %ld\n"
" tolerance: %ld\n"
"-t tick: %ld\n"
@ -19,9 +19,22 @@
" return value: %d (%s)\n",
txc.constant,
txc.precision, txc.tolerance, txc.tick,
- txc.time.tv_sec, txc.time.tv_usec, ret,
+ (int64_t)txc.time.tv_sec, (int64_t)txc.time.tv_usec, ret,
(ret >= 0 && ret <= 5) ? ret_code_descript[ret] : "error" );
}
return (ret<0);
--- a/ntpclient.c
+++ b/ntpclient.c
@@ -181,7 +181,7 @@ static void set_time(struct ntptime *new)
@@ -29,6 +29,7 @@
* labelled "XXX fixme - non-automatic build configuration".
*/
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -181,7 +182,7 @@ static void set_time(struct ntptime *new)
exit(1);
}
if (debug) {
@ -30,7 +43,7 @@
}
#else
/* Traditional Linux way to set the system clock
@@ -196,7 +196,7 @@ static void set_time(struct ntptime *new)
@@ -196,7 +197,7 @@ static void set_time(struct ntptime *new)
exit(1);
}
if (debug) {

View File

@ -1,6 +1,6 @@
--- a/ntpclient.c
+++ b/ntpclient.c
@@ -42,6 +42,9 @@
@@ -43,6 +43,9 @@
#include <errno.h>
#ifdef PRECISION_SIOCGSTAMP
#include <sys/ioctl.h>