diff options
author | Martin Pool <mbp@samba.org> | 2001-08-08 10:04:40 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2001-08-08 10:04:40 +0000 |
commit | fab9a9c54729984199d20b637ea8cc163c73d2e2 (patch) | |
tree | 49199a55f71f77193e7e298e80d3189ccb52dd8a | |
parent | 376acbfad54c4a24ade440a880bc8e0b87951811 (diff) | |
download | rsync-fab9a9c54729984199d20b637ea8cc163c73d2e2.tar.gz rsync-fab9a9c54729984199d20b637ea8cc163c73d2e2.tar.bz2 rsync-fab9a9c54729984199d20b637ea8cc163c73d2e2.zip |
Another try at socklen_t: just check for it, and otherwise use int.
The HP manual says this will work on old HP/UX versions; I'm not sure
about other systems. Possibly it will break on old BSD-derived
systems with 32-bit int, 64-bit size_t and no socklen_t, if there are
any such.
-rw-r--r-- | aclocal.m4 | 18 | ||||
-rw-r--r-- | configure.in | 3 |
2 files changed, 13 insertions, 8 deletions
@@ -102,8 +102,9 @@ dnl POSIX 1g it is a type of its own, but some platforms use different dnl types for the argument to getsockopt, getpeername, etc. So we dnl have to test to find something that will work. -dnl This test originally comes from lftp, by way of Albert Chin at The -dnl Written Word. Thanks! +dnl This is no good, because passing the wrong pointer on C compilers is +dnl likely to only generate a warning, not an error. We don't call this at +dnl the moment. AC_DEFUN([TYPE_SOCKLEN_T], [ @@ -116,8 +117,8 @@ AC_DEFUN([TYPE_SOCKLEN_T], #include <sys/socket.h> ], [ - socklen_t len; - getpeername(0,0,&len); + socklen_t len; + getpeername(0,0,&len); ], [ lftp_cv_socklen_t=yes @@ -136,13 +137,16 @@ AC_DEFUN([TYPE_SOCKLEN_T], #include <sys/socket.h> ], [ - $t len; - getpeername(0,0,&len); + $t len; + getpeername(0,0,&len); ], [ lftp_cv_socklen_t_equiv="$t" break - ]) + ], + [ + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + ]) done ]) AC_MSG_RESULT($lftp_cv_socklen_t_equiv) diff --git a/configure.in b/configure.in index d5c626d3..e08249da 100644 --- a/configure.in +++ b/configure.in @@ -77,7 +77,8 @@ AC_TYPE_PID_T AC_TYPE_GETGROUPS AC_STRUCT_ST_RDEV AC_CHECK_TYPE([ino_t], [unsigned]) -TYPE_SOCKLEN_T +dnl TYPE_SOCKLEN_T +AC_CHECK_TYPE([socklen_t], [size_t]) AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [ AC_TRY_COMPILE([#include <errno.h>],[int i = errno], |