From: Martin Pool Date: Mon, 6 Aug 2001 12:27:04 +0000 (+0000) Subject: Use socklen_t if defined, or otherwise int. This tries to fix X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/ac2a1a449d04d27feb72a61ef0739bae1fb52f52 Use socklen_t if defined, or otherwise int. This tries to fix warnings on platforms (e.g. AIX) where this type is defined and not int. --- diff --git a/configure.in b/configure.in index 21ac489c..95b47b42 100644 --- a/configure.in +++ b/configure.in @@ -77,6 +77,7 @@ AC_TYPE_PID_T AC_TYPE_GETGROUPS AC_STRUCT_ST_RDEV AC_CHECK_TYPE([ino_t], [unsigned]) +AC_CHECK_TYPE([socklen_t], [int]) AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [ AC_TRY_COMPILE([#include ],[int i = errno], diff --git a/socket.c b/socket.c index ad208ef5..cfc13611 100644 --- a/socket.c +++ b/socket.c @@ -227,13 +227,14 @@ static int open_socket_in(int type, int port, struct in_addr *address) */ int is_a_socket(int fd) { - int v, l; + int v; + socklen_t l; l = sizeof(int); /* Parameters to getsockopt, setsockopt etc are very * unstandardized across platforms, so don't be surprised if - * there are compiler warnings on e.g. SCO OpenSwerver. It - * seems they all eventually get the right idea. + * there are compiler warnings on e.g. SCO OpenSwerver or AIX. + * It seems they all eventually get the right idea. * * Debian says: ``The fifth argument of getsockopt and * setsockopt is in reality an int [*] (and this is what BSD