summaryrefslogtreecommitdiff
path: root/src/clients/s6-dnssrv.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-12 15:35:29 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-12 15:35:29 +0000
commit3f9536c5cc9ed6659ad2514859bd1716cbf7b26b (patch)
tree3f01ca46f59b9458c93ace3f07127d1e2bb460e8 /src/clients/s6-dnssrv.c
parent3a289d1ca8dd2bce4a8bb6549709ea62262ec786 (diff)
downloads6-dns-3f9536c5cc9ed6659ad2514859bd1716cbf7b26b.tar.xz
Types fix, first pass.
Some places marked XXX for the skalibs API change.
Diffstat (limited to 'src/clients/s6-dnssrv.c')
-rw-r--r--src/clients/s6-dnssrv.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/clients/s6-dnssrv.c b/src/clients/s6-dnssrv.c
index 283f1cd..47f5df0 100644
--- a/src/clients/s6-dnssrv.c
+++ b/src/clients/s6-dnssrv.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <sys/types.h>
#include <errno.h>
#include <skalibs/uint.h>
#include <skalibs/bytestr.h>
@@ -18,7 +19,8 @@ int main (int argc, char const *const *argv)
{
genalloc srvs = GENALLOC_ZERO ; /* array of s6dns_message_rr_srv_t */
tain_t deadline ;
- unsigned int i = 0 ;
+ size_t i = 0 ;
+ unsigned int t = 0 ;
int flagqualify = 0 ;
int flagunsort = 0 ;
PROG = "s6-dnssrv" ;
@@ -30,7 +32,7 @@ int main (int argc, char const *const *argv)
{
case 'q' : flagqualify = 1 ; break ;
case 'r' : flagunsort = 1 ; break ;
- case 't' : if (!uint0_scan(subgetopt_here.arg, &i)) dieusage() ; break ;
+ case 't' : if (!uint0_scan(subgetopt_here.arg, &t)) dieusage() ; break ;
default : dieusage() ;
}
}
@@ -38,13 +40,13 @@ int main (int argc, char const *const *argv)
if (argc < 3) dieusage() ;
tain_now_g() ;
- if (i) tain_from_millisecs(&deadline, i) ; else deadline = tain_infinite_relative ;
+ if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ;
tain_add_g(&deadline, &deadline) ;
if (!s6dns_init()) strerr_diefu1sys(111, "s6dns_init") ;
{
- unsigned int n0 = str_len(argv[0]) ;
- unsigned int n1 = str_len(argv[1]) ;
- unsigned int n2 = str_len(argv[2]) ;
+ size_t n0 = str_len(argv[0]) ;
+ size_t n1 = str_len(argv[1]) ;
+ size_t n2 = str_len(argv[2]) ;
char name[n0 + n1 + n2 + 5] ;
name[0] = '_' ;
byte_copy(name + 1, n0, argv[0]) ;
@@ -63,7 +65,7 @@ int main (int argc, char const *const *argv)
for (i = 0 ; i < genalloc_len(s6dns_message_rr_srv_t, &srvs) ; i++)
{
char buf[S6DNS_FMT_SRV] ;
- register unsigned int len = s6dns_fmt_srv(buf, S6DNS_FMT_SRV, genalloc_s(s6dns_message_rr_srv_t, &srvs) + i) ;
+ register size_t len = s6dns_fmt_srv(buf, S6DNS_FMT_SRV, genalloc_s(s6dns_message_rr_srv_t, &srvs) + i) ;
if (!len) strerr_diefu1sys(111, "format result") ;
if (buffer_put(buffer_1, buf, len) < 0) goto err ;
if (buffer_put(buffer_1, "\n", 1) < 0) goto err ;