summaryrefslogtreecommitdiff
path: root/package/rdate
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-01-01 20:19:13 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2014-01-01 20:19:13 +0100
commit8207b8d44693503e1c086aea0fc30c592a59b15d (patch)
tree8ebb77c7ae0097d4877bed3099a49ce7518a2f63 /package/rdate
parentf3f7a7f082ffce3fe30555c73276f4c070c0b6da (diff)
another round of updates and musl fixes
Diffstat (limited to 'package/rdate')
-rw-r--r--package/rdate/Makefile1
-rw-r--r--package/rdate/patches/patch-ntp_c50
-rw-r--r--package/rdate/patches/patch-rdate_h11
-rw-r--r--package/rdate/patches/patch-rfc868time_c11
4 files changed, 73 insertions, 0 deletions
diff --git a/package/rdate/Makefile b/package/rdate/Makefile
index 140857170..619b5ad6a 100644
--- a/package/rdate/Makefile
+++ b/package/rdate/Makefile
@@ -18,6 +18,7 @@ include ${TOPDIR}/mk/package.mk
$(eval $(call PKG_template,RDATE,rdate,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
CONFIG_STYLE:= manual
+TARGET_CPPFLAGS+= -D_GNU_SOURCE
MAKE_FILE= GNUmakefile
rdate-install:
diff --git a/package/rdate/patches/patch-ntp_c b/package/rdate/patches/patch-ntp_c
new file mode 100644
index 000000000..d36d421cd
--- /dev/null
+++ b/package/rdate/patches/patch-ntp_c
@@ -0,0 +1,50 @@
+--- rdate.orig/ntp.c 2007-08-17 17:03:24.000000000 +0200
++++ rdate/ntp.c 2013-12-30 23:07:06.000000000 +0100
+@@ -37,6 +37,7 @@
+ #include <sys/time.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <sys/types.h>
+
+ #include <ctype.h>
+ #include <err.h>
+@@ -100,9 +101,9 @@ struct ntp_data {
+ double transmit;
+ double current;
+ double originate;
+- u_int64_t xmitck;
+- u_int64_t recvck;
+- u_int32_t refid;
++ uint64_t xmitck;
++ uint64_t recvck;
++ uint32_t refid;
+ u_char status;
+ u_char version;
+ u_char mode;
+@@ -268,7 +269,7 @@ write_packet(int fd, struct ntp_data *da
+
+ packet[0] = ((nver ? nver : NTP_VERSION) << 3) | (NTP_MODE_CLIENT);
+
+- data->xmitck = (u_int64_t)arc4random() << 32 | arc4random();
++ data->xmitck = (uint64_t)arc4random() << 32 | arc4random();
+
+ /*
+ * Send out a random 64-bit number as our transmit time. The NTP
+@@ -286,7 +287,7 @@ write_packet(int fd, struct ntp_data *da
+ * the transmit field intelligible.
+ */
+
+- memcpy(packet + NTP_TRANSMIT, &data->xmitck, sizeof (u_int64_t));
++ memcpy(packet + NTP_TRANSMIT, &data->xmitck, sizeof (uint64_t));
+
+ data->originate = current_time(JAN_1970);
+
+@@ -437,7 +438,7 @@ unpack_ntp(struct ntp_data *data, u_char
+ data->transmit = d / NTP_SCALE;
+
+ /* See write_packet for why this isn't an endian problem. */
+- memcpy(&data->recvck, packet + NTP_ORIGINATE, sizeof (u_int64_t));
++ memcpy(&data->recvck, packet + NTP_ORIGINATE, sizeof (uint64_t));
+ }
+
+ /*
diff --git a/package/rdate/patches/patch-rdate_h b/package/rdate/patches/patch-rdate_h
new file mode 100644
index 000000000..33c4f1b3a
--- /dev/null
+++ b/package/rdate/patches/patch-rdate_h
@@ -0,0 +1,11 @@
+--- rdate.orig/rdate.h 2007-08-16 12:38:52.000000000 +0200
++++ rdate/rdate.h 2013-12-30 23:00:23.000000000 +0100
+@@ -10,7 +10,7 @@
+ #endif
+
+ #ifdef EXT_A4R
+-extern u_int32_t arc4random(void);
++extern uint32_t arc4random(void);
+ #endif
+
+ #ifdef __MirBSD__
diff --git a/package/rdate/patches/patch-rfc868time_c b/package/rdate/patches/patch-rfc868time_c
new file mode 100644
index 000000000..b095278ba
--- /dev/null
+++ b/package/rdate/patches/patch-rfc868time_c
@@ -0,0 +1,11 @@
+--- rdate.orig/rfc868time.c 2007-08-11 01:52:47.000000000 +0200
++++ rdate/rfc868time.c 2013-12-30 23:07:29.000000000 +0100
+@@ -70,7 +70,7 @@ rfc868time_client (const char *hostname,
+ {
+ struct addrinfo hints, *res0, *res;
+ struct timeval old;
+- u_int32_t tim; /* RFC 868 states clearly this is an uint32 */
++ uint32_t tim; /* RFC 868 states clearly this is an uint32 */
+ int s;
+ int error;
+