chiark / gitweb /
Portability: Use `socklen_t' throughout, if available.
[tripe] / server / peer.c
index f4d80665fe64b10b5e05269c17a84be2cf44c615..06dd33db2c29e15bfa42b112d151f8e896f3b1c4 100644 (file)
@@ -306,7 +306,7 @@ static void p_read(int fd, unsigned mode, void *v)
 {
   peer *p = 0;
   addr a;
 {
   peer *p = 0;
   addr a;
-  size_t sz;
+  socklen_t sz;
   ssize_t n;
   int ch;
   buf b, bb;
   ssize_t n;
   int ch;
   buf b, bb;
@@ -798,7 +798,7 @@ void p_init(struct in_addr addr, unsigned port)
 unsigned p_port(void)
 {
   addr a;
 unsigned p_port(void)
 {
   addr a;
-  size_t sz = sizeof(addr);
+  socklen_t sz = sizeof(addr);
 
   if (getsockname(sock.fd, &a.sa, &sz))
     die(EXIT_FAILURE, "couldn't read port number: %s", strerror(errno));
 
   if (getsockname(sock.fd, &a.sa, &sz))
     die(EXIT_FAILURE, "couldn't read port number: %s", strerror(errno));