From: Ronnie Sahlberg Date: Wed, 1 Jun 2011 11:31:40 +0000 (+1000) Subject: Use HAVE_SOCK_SIN_LEN and set ->sin_len X-Git-Tag: upstream/1.9.6^2~410 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ea214e456602b16f7dc43bfa163cb630e1871d23;p=deb_libnfs.git Use HAVE_SOCK_SIN_LEN and set ->sin_len for legacy unixens (AIX) so that we will compile and run on those systems with a "weird" sockaddr_in definition. --- diff --git a/lib/socket.c b/lib/socket.c index 1de64b6..d4354bb 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -251,8 +251,11 @@ int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc switch (s.ss_family) { case AF_INET: - rpc->fd = socket(AF_INET, SOCK_STREAM, 0); socksize = sizeof(struct sockaddr_in); +#ifdef HAVE_SOCK_SIN_LEN + sin->sin_len = socksize; +#endif + rpc->fd = socket(AF_INET, SOCK_STREAM, 0); break; }