add back a check for sa_len in sockaddr structure.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 2 Jul 2011 21:41:15 +0000 (07:41 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 2 Jul 2011 21:41:15 +0000 (07:41 +1000)
configure.ac
lib/socket.c

index 94783ec74875e75b085958308691bd91aec8c884..70203ee1594b4b89fa3d20c819c5ed73e1211353 100644 (file)
@@ -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 <sys/types.h>
+#include <sys/socket.h>
+])
+
 #output
 AC_CONFIG_FILES([Makefile]
                 [include/Makefile]
index dcbd1c177fd9be1d998399630ad8787be8deb441..e4de894c854e3e752271b1a3cb6833b400ec1a2c 100644 (file)
@@ -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);