From 53091e3bce487ee82e2805a0231e780551561717 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 12 Mar 2017 19:39:01 +0000 Subject: Adapt to skalibs-2.5.0.0 --- src/clock/s6-sntpclock.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/clock/s6-sntpclock.c') diff --git a/src/clock/s6-sntpclock.c b/src/clock/s6-sntpclock.c index 22c6727..1044be5 100644 --- a/src/clock/s6-sntpclock.c +++ b/src/clock/s6-sntpclock.c @@ -1,17 +1,14 @@ /* ISC license. */ -#include +#include #include #include #include #include -#include -#include #include -#include +#include #include #include -#include #include #include #include @@ -26,12 +23,12 @@ static unsigned int verbosity = 1 ; -int ntp_exchange (int s, ip46_t const *ip, uint16 port, tain_t *stamps, tain_t const *deadline) +int ntp_exchange (int s, ip46_t const *ip, uint16_t port, tain_t *stamps, tain_t const *deadline) { char query[48] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ; char answer[48] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ; tain_t starttime ; - uint64 ntpstamp ; + uint64_t ntpstamp ; ip46_t dummyip ; uint16_t dummyport ; ssize_t r ; @@ -54,7 +51,7 @@ int ntp_exchange (int s, ip46_t const *ip, uint16 port, tain_t *stamps, tain_t c if (r < 48) return (errno = EPROTO, 0) ; if (((answer[0] & 7) != 2) && ((answer[0] & 7) != 4)) return (errno = EPROTO, 0) ; if (!(answer[0] & 56)) return (errno = EPROTO, 0) ; - if (byte_diff(query+40, 8, answer+24)) return (errno = EPROTO, 0) ; + if (memcmp(query+40, answer+24, 8)) return (errno = EPROTO, 0) ; stamps[0] = starttime ; uint64_unpack_big(answer+32, &ntpstamp) ; tain_from_ntp(stamps+1, ntpstamp) ; @@ -100,7 +97,7 @@ int main (int argc, char const *const *argv) subgetopt_t l = SUBGETOPT_ZERO ; for (;;) { - register int opt = subgetopt_r(argc, argv, "fv:r:t:h:T:e:p:", &l) ; + int opt = subgetopt_r(argc, argv, "fv:r:t:h:T:e:p:", &l) ; if (opt == -1) break ; switch (opt) { @@ -169,7 +166,7 @@ int main (int argc, char const *const *argv) unsigned int j = 0 ; for (; j < 4 ; j++) { - uint64 ntp ; + uint64_t ntp ; localtmn_t l ; char fmt[UINT_FMT] ; char fmtntp[UINT64_XFMT] ; -- cgit v1.3.1