From f7f931c7e3a382b964ed6464125cf261e7358bf8 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 3 Jul 2011 07:41:15 +1000 Subject: [PATCH] add back a check for sa_len in sockaddr structure. --- configure.ac | 10 ++++++++++ lib/socket.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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); -- 2.34.1