ntpclient: fixup time patch
authorRosen Penev <rosenp@gmail.com>
Sat, 11 Apr 2020 05:22:14 +0000 (22:22 -0700)
committerRosen Penev <rosenp@gmail.com>
Sun, 12 Apr 2020 02:52:44 +0000 (19:52 -0700)
Added missing header and added casts.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/ntpclient/Makefile
net/ntpclient/patches/200-time.patch
net/ntpclient/patches/300-siocgarp.patch

index 406bd6b3a14c6e66e5df014be1c8830bd3b81930..ffe9e8841222693e053f1cfb741cd4f785f82432 100644 (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
index d1d7c9e8f071a8d56308b8657364c389cb45204c..6456f3093707368e5b9753d062443b9c675bbc4f 100644 (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"
                        "    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) {
index db4a80c2a3a5d467031d6b99088918d0c5520af7..e03c9b93e3be08fa234c0498eb41e6f4ffa5d8f2 100644 (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>