summaryrefslogtreecommitdiff
path: root/src/clock
diff options
context:
space:
mode:
Diffstat (limited to 'src/clock')
-rw-r--r--src/clock/s6-sntpclock.c8
-rw-r--r--src/clock/s6-taiclock.c7
-rw-r--r--src/clock/s6-taiclockd.c7
3 files changed, 14 insertions, 8 deletions
diff --git a/src/clock/s6-sntpclock.c b/src/clock/s6-sntpclock.c
index a7bcc22..22c6727 100644
--- a/src/clock/s6-sntpclock.c
+++ b/src/clock/s6-sntpclock.c
@@ -1,11 +1,13 @@
/* ISC license. */
#include <sys/types.h>
+#include <stdint.h>
#include <unistd.h>
#include <errno.h>
#include <skalibs/error.h>
#include <skalibs/uint16.h>
#include <skalibs/uint32.h>
+#include <skalibs/uint64.h>
#include <skalibs/uint.h>
#include <skalibs/sgetopt.h>
#include <skalibs/allreadwrite.h>
@@ -31,8 +33,8 @@ int ntp_exchange (int s, ip46_t const *ip, uint16 port, tain_t *stamps, tain_t c
tain_t starttime ;
uint64 ntpstamp ;
ip46_t dummyip ;
- uint16 dummyport ;
- int r ;
+ uint16_t dummyport ;
+ ssize_t r ;
tain_copynow(&starttime) ;
query[0] = 35 ; /* SNTPv4, client */
if (!ntp_from_tain(&ntpstamp, &starttime)) return 0 ;
@@ -87,7 +89,7 @@ int main (int argc, char const *const *argv)
int sock ;
int flagforce = 0 ;
ip46_t ipremote ;
- uint16 portremote = 123 ;
+ uint16_t portremote = 123 ;
PROG = "s6-sntpclock" ;
{
diff --git a/src/clock/s6-taiclock.c b/src/clock/s6-taiclock.c
index d8d371f..bece37d 100644
--- a/src/clock/s6-taiclock.c
+++ b/src/clock/s6-taiclock.c
@@ -1,6 +1,7 @@
/* ISC license. */
#include <sys/types.h>
+#include <stdint.h>
#include <unistd.h>
#include <errno.h>
#include <skalibs/error.h>
@@ -31,8 +32,8 @@ int tain_exchange (int s, ip46_t const *ip, uint16 port, tain_t *serversays, tai
char query[N] = "ctai" ;
char answer[N] ;
ip46_t dummyip ;
- int r ;
- uint16 dummyport ;
+ ssize_t r ;
+ uint16_t dummyport ;
tain_pack(query+4, &STAMP) ;
random_string(query+20, N-20) ; /* cookie */
r = socket_sendnb46_g(s, query, N, ip, port, deadline) ;
@@ -60,7 +61,7 @@ int main (int argc, char const *const *argv)
ip46_t ipremote ;
int sock ;
int flagforce = 0 ;
- uint16 portremote = 4014 ;
+ uint16_t portremote = 4014 ;
PROG = "s6-taiclock" ;
{
diff --git a/src/clock/s6-taiclockd.c b/src/clock/s6-taiclockd.c
index b206400..0477ec5 100644
--- a/src/clock/s6-taiclockd.c
+++ b/src/clock/s6-taiclockd.c
@@ -1,5 +1,8 @@
/* ISC license. */
+#include <sys/types.h>
+#include <stdint.h>
+#include <skalibs/uint16.h>
#include <skalibs/bytestr.h>
#include <skalibs/sgetopt.h>
#include <skalibs/strerr2.h>
@@ -16,7 +19,7 @@ int main (int argc, char const *const *argv)
{
int s ;
ip46_t ip = IP46_ZERO ;
- uint16 port = 4014 ;
+ uint16_t port = 4014 ;
subgetopt_t l = SUBGETOPT_ZERO ;
PROG = "s6-taiclockd" ;
for (;;)
@@ -40,7 +43,7 @@ int main (int argc, char const *const *argv)
for (;;)
{
char packet[256] ;
- register int r = socket_recv46(s, packet, 256, &ip, &port) ;
+ register ssize_t r = socket_recv46(s, packet, 256, &ip, &port) ;
if ((r >= 20) && !byte_diff(packet, 4, "ctai"))
{
tain_t now ;