chiark / gitweb /
Portability: Use `socklen_t' throughout, if available.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 19 Feb 2016 21:41:04 +0000 (21:41 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 30 Apr 2016 17:11:37 +0000 (18:11 +0100)
Silly amd64 people, not using `size_t'.

configure.ac
pathmtu/pathmtu.c
server/admin.c
server/peer.c

index 9583b73a2be064366971968a6b8e8e34c5f3a638..004304cde6c997502b1b6ca5526194c039688dc0 100644 (file)
@@ -36,6 +36,7 @@ mdw_SILENT_RULES
 AC_PROG_CC
 AM_PROG_CC_C_O
 AX_CFLAGS_WARN_ALL
 AC_PROG_CC
 AM_PROG_CC_C_O
 AX_CFLAGS_WARN_ALL
+AX_TYPE_SOCKLEN_T
 AC_CANONICAL_HOST
 AM_PROG_LIBTOOL
 
 AC_CANONICAL_HOST
 AM_PROG_LIBTOOL
 
index e8861f705d6991a431fba4c3455c391d690bbe74..9516cd2e21c2b8ce011f3d6db929fce1daa6d1b6 100644 (file)
@@ -403,7 +403,7 @@ struct raw_state {
 static int raw_setup(void *stv, int sk, const struct param *pp)
 {
   struct raw_state *st = stv;
 static int raw_setup(void *stv, int sk, const struct param *pp)
 {
   struct raw_state *st = stv;
-  size_t sz;
+  socklen_t sz;
   int i, mtu = -1;
   struct ifaddrs *ifa, *ifaa, *ifap;
   struct ifreq ifr;
   int i, mtu = -1;
   struct ifaddrs *ifa, *ifaa, *ifap;
   struct ifreq ifr;
@@ -617,7 +617,7 @@ static int linux_setup(void *stv, int sk, const struct param *pp)
 {
   struct linux_state *st = stv;
   int i, mtu;
 {
   struct linux_state *st = stv;
   int i, mtu;
-  size_t sz;
+  socklen_t sz;
 
   /* Snaffle the UDP socket. */
   st->sk = sk;
 
   /* Snaffle the UDP socket. */
   st->sk = sk;
@@ -655,7 +655,7 @@ static int linux_selproc(void *stv, fd_set *fd_in, struct probestate *ps)
 {
   struct linux_state *st = stv;
   int mtu;
 {
   struct linux_state *st = stv;
   int mtu;
-  size_t sz;
+  socklen_t sz;
   ssize_t n;
   unsigned char b[65536];
 
   ssize_t n;
   unsigned char b[65536];
 
index 25581f656479b7f9cc680c1d7782e559502a645d..ef5fddf3e24c49f5fe8f8db8e91671a402d9a38a 100644 (file)
@@ -2237,7 +2237,7 @@ static void a_accept(int fd, unsigned mode, void *v)
 {
   int nfd;
   struct sockaddr_un sun;
 {
   int nfd;
   struct sockaddr_un sun;
-  size_t sz = sizeof(sun);
+  socklen_t sz = sizeof(sun);
 
   if ((nfd = accept(fd, (struct sockaddr *)&sun, &sz)) < 0) {
     if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK &&
 
   if ((nfd = accept(fd, (struct sockaddr *)&sun, &sz)) < 0) {
     if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK &&
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));