From: Ronnie Sahlberg Date: Sat, 2 Jul 2011 21:41:15 +0000 (+1000) Subject: add back a check for sa_len in sockaddr structure. X-Git-Tag: upstream/1.9.6^2~355 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f7f931c7e3a382b964ed6464125cf261e7358bf8;p=deb_libnfs.git add back a check for sa_len in sockaddr structure. --- diff --git a/configure.ac b/configure.ac index 94783ec..70203ee 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,16 @@ esac AC_SUBST(RPCGENFLAGS) +# check for SA_LEN +dnl Check if sockaddr data structure includes a "sa_len" +AC_CHECK_MEMBER([struct sockaddr.sa_len], + [ AC_DEFINE(HAVE_SOCKADDR_LEN,1,[Whether sockaddr struct has sa_len]) ], + [], + [ +#include +#include +]) + #output AC_CONFIG_FILES([Makefile] [include/Makefile] diff --git a/lib/socket.c b/lib/socket.c index dcbd1c1..e4de894 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -311,7 +311,7 @@ int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc switch (s.ss_family) { case AF_INET: socksize = sizeof(struct sockaddr_in); -#ifdef HAVE_SOCK_SIN_LEN +#ifdef HAVE_SOCKADDR_LEN sin->sin_len = socksize; #endif rpc->fd = socket(AF_INET, SOCK_STREAM, 0);