From: wessels <> Date: Wed, 19 Aug 1998 01:13:52 +0000 (+0000) Subject: linux fixes, mostly socklen_t X-Git-Tag: SQUID_3_0_PRE1~2853 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6637e3a5a7325c09766a5496661c00ab2e0ca09d;p=thirdparty%2Fsquid.git linux fixes, mostly socklen_t --- diff --git a/configure b/configure index 758bc23ff3..a29721f793 100755 --- a/configure +++ b/configure @@ -575,7 +575,7 @@ fi -# From configure.in Revision: 1.140 +# From configure.in Revision: 1.141 ac_aux_dir= for ac_dir in cfgaux $srcdir/cfgaux; do if test -f $ac_dir/install-sh; then @@ -2982,8 +2982,45 @@ EOF fi +echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 +echo "configure:2987: checking for socklen_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_socklen_t=yes +else + rm -rf conftest* + ac_cv_type_socklen_t=no +fi +rm -f conftest* + + +fi + +echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 +if test $ac_cv_type_socklen_t = no; then + cat >> confdefs.h <<\EOF +#define socklen_t int +EOF + +fi + echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:2987: checking for main in -lnsl" >&5 +echo "configure:3024: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2991,14 +3028,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3026,7 +3063,7 @@ else fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:3030: checking for main in -lsocket" >&5 +echo "configure:3067: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3034,14 +3071,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3073,7 +3110,7 @@ if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then echo "skipping libmalloc check (--enable-dlmalloc specified)" else echo $ac_n "checking for main in -lgnumalloc""... $ac_c" 1>&6 -echo "configure:3077: checking for main in -lgnumalloc" >&5 +echo "configure:3114: checking for main in -lgnumalloc" >&5 ac_lib_var=`echo gnumalloc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3081,14 +3118,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnumalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3131,7 +3168,7 @@ fi *) echo $ac_n "checking for main in -lmalloc""... $ac_c" 1>&6 -echo "configure:3135: checking for main in -lmalloc" >&5 +echo "configure:3172: checking for main in -lmalloc" >&5 ac_lib_var=`echo malloc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3139,14 +3176,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3179,7 +3216,7 @@ fi fi echo $ac_n "checking for main in -lbsd""... $ac_c" 1>&6 -echo "configure:3183: checking for main in -lbsd" >&5 +echo "configure:3220: checking for main in -lbsd" >&5 ac_lib_var=`echo bsd'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3187,14 +3224,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3222,7 +3259,7 @@ else fi echo $ac_n "checking for main in -lregex""... $ac_c" 1>&6 -echo "configure:3226: checking for main in -lregex" >&5 +echo "configure:3263: checking for main in -lregex" >&5 ac_lib_var=`echo regex'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3230,14 +3267,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lregex $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3263,7 +3300,7 @@ case "$host" in ;; *) echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:3267: checking for inet_aton in -lresolv" >&5 +echo "configure:3304: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3271,7 +3308,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3298,7 +3335,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for inet_aton in -l44bsd""... $ac_c" 1>&6 -echo "configure:3302: checking for inet_aton in -l44bsd" >&5 +echo "configure:3339: checking for inet_aton in -l44bsd" >&5 ac_lib_var=`echo 44bsd'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3306,7 +3343,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3349,7 +3386,7 @@ else fi echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:3353: checking for main in -lresolv" >&5 +echo "configure:3390: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3357,14 +3394,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3394,7 +3431,7 @@ fi ;; esac echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:3398: checking for main in -lm" >&5 +echo "configure:3435: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3402,14 +3439,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3438,7 +3475,7 @@ fi echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:3442: checking for crypt in -lcrypt" >&5 +echo "configure:3479: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3446,7 +3483,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3490,7 +3527,7 @@ fi echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:3494: checking for main in -lpthread" >&5 +echo "configure:3531: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3498,14 +3535,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3651,12 +3688,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3655: checking for $ac_func" >&5 +echo "configure:3692: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3705,7 +3742,7 @@ done echo $ac_n "checking if setresuid is implemented""... $ac_c" 1>&6 -echo "configure:3709: checking if setresuid is implemented" >&5 +echo "configure:3746: checking if setresuid is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3713,7 +3750,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3726,7 +3763,7 @@ else } EOF -if { (eval echo configure:3730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setresuid="yes" else @@ -3760,13 +3797,13 @@ if test -z "$USE_GNUREGEX" ; then esac fi echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6 -echo "configure:3764: checking if GNUregex needs to be compiled" >&5 +echo "configure:3801: checking if GNUregex needs to be compiled" >&5 if test -z "$USE_GNUREGEX"; then if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then USE_GNUREGEX="yes" else cat > conftest.$ac_ext < #include @@ -3774,7 +3811,7 @@ int main() { regex_t t; regcomp(&t,"",0); ; return 0; } EOF -if { (eval echo configure:3778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* USE_GNUREGEX="no" else @@ -3804,12 +3841,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3808: checking for $ac_func" >&5 +echo "configure:3845: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3860,12 +3897,12 @@ done echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6 -echo "configure:3864: checking Default FD_SETSIZE value" >&5 +echo "configure:3901: checking Default FD_SETSIZE value" >&5 if test "$cross_compiling" = yes; then DEFAULT_FD_SETSIZE=256 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then DEFAULT_FD_SETSIZE=`cat conftestval` else @@ -3908,12 +3945,12 @@ EOF echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6 -echo "configure:3912: checking Maximum number of filedescriptors we can open" >&5 +echo "configure:3949: checking Maximum number of filedescriptors we can open" >&5 if test "$cross_compiling" = yes; then SQUID_MAXFD=256 else cat > conftest.$ac_ext < @@ -3972,7 +4009,7 @@ main() { } EOF -if { (eval echo configure:3976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_MAXFD=`cat conftestval` else @@ -3998,12 +4035,12 @@ if test "$SQUID_MAXFD" -lt 512 ; then fi echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6 -echo "configure:4002: checking Default UDP send buffer size" >&5 +echo "configure:4039: checking Default UDP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -4022,7 +4059,7 @@ main () } EOF -if { (eval echo configure:4026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_SNDBUF=`cat conftestval` else @@ -4041,12 +4078,12 @@ EOF echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6 -echo "configure:4045: checking Default UDP receive buffer size" >&5 +echo "configure:4082: checking Default UDP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -4065,7 +4102,7 @@ main () } EOF -if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_RCVBUF=`cat conftestval` else @@ -4084,12 +4121,12 @@ EOF echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6 -echo "configure:4088: checking Default TCP send buffer size" >&5 +echo "configure:4125: checking Default TCP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -4108,7 +4145,7 @@ main () } EOF -if { (eval echo configure:4112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_SNDBUF=`cat conftestval` else @@ -4127,12 +4164,12 @@ EOF echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6 -echo "configure:4131: checking Default TCP receive buffer size" >&5 +echo "configure:4168: checking Default TCP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -4151,7 +4188,7 @@ main () } EOF -if { (eval echo configure:4155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_RCVBUF=`cat conftestval` else @@ -4170,19 +4207,19 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 -echo "configure:4174: checking if sys_errlist is already defined" >&5 +echo "configure:4211: checking if sys_errlist is already defined" >&5 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *s = sys_errlist0; ; return 0; } EOF -if { (eval echo configure:4186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_needs_sys_errlist="no" else @@ -4204,16 +4241,16 @@ EOF fi echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6 -echo "configure:4208: checking for libresolv _dns_ttl_ hack" >&5 +echo "configure:4245: checking for libresolv _dns_ttl_ hack" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF diff --git a/configure.in b/configure.in index 8b26bcc6bb..0b44460aef 100644 --- a/configure.in +++ b/configure.in @@ -3,13 +3,13 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.141 1998/08/18 16:13:56 wessels Exp $ +dnl $Id: configure.in,v 1.142 1998/08/18 19:13:53 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.141 $)dnl +AC_REVISION($Revision: 1.142 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(cfgaux) @@ -603,6 +603,21 @@ AC_CHECK_TYPE(ssize_t, int) AC_CHECK_TYPE(off_t, int) AC_CHECK_TYPE(mode_t, u_short) +dnl Check for type in sys/socket.h +AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [ + AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include +#include +#if STDC_HEADERS +#include +#include +#endif], + ac_cv_type_socklen_t=yes, + ac_cv_type_socklen_t=no) +]) +if test $ac_cv_type_socklen_t = no; then + AC_DEFINE(socklen_t, int) +fi + dnl Check for needed libraries AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(socket, main) diff --git a/include/radix.h b/include/radix.h index 366b5deab0..03406b94f4 100644 --- a/include/radix.h +++ b/include/radix.h @@ -48,14 +48,14 @@ struct radix_node { struct radix_node *rn_p; /* parent */ short rn_b; /* bit offset; -1-index(netmask) */ char rn_bmask; /* node: mask for bit test */ - u_char rn_flags; /* enumerated next */ + unsigned char rn_flags; /* enumerated next */ #define RNF_NORMAL 1 /* leaf contains normal route */ #define RNF_ROOT 2 /* leaf is root leaf for tree */ #define RNF_ACTIVE 4 /* This node is alive (for rtfree) */ union { struct { /* leaf only data: */ - caddr_t rn_Key; /* object of search */ - caddr_t rn_Mask; /* netmask, if present */ + void * rn_Key; /* object of search */ + void * rn_Mask; /* netmask, if present */ struct radix_node *rn_Dupedkey; } rn_leaf; struct { /* node only data: */ @@ -85,10 +85,10 @@ struct radix_node { extern struct radix_mask { short rm_b; /* bit offset; -1-index(netmask) */ char rm_unused; /* cf. rn_bmask */ - u_char rm_flags; /* cf. rn_flags */ + unsigned char rm_flags; /* cf. rn_flags */ struct radix_mask *rm_mklist; /* more masks to try */ union { - caddr_t rmu_mask; /* the mask */ + void * rmu_mask; /* the mask */ struct radix_node *rmu_leaf; /* for normal routes */ } rm_rmu; int rm_refs; /* # of references to this struct */ diff --git a/lib/GNUregex.c b/lib/GNUregex.c index 779574f173..185ec93b16 100644 --- a/lib/GNUregex.c +++ b/lib/GNUregex.c @@ -24,7 +24,9 @@ #pragma alloca #endif -#define _GNU_SOURCE +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif #include "config.h" diff --git a/src/comm.cc b/src/comm.cc index 6215c99152..4dde1626cb 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.282 1998/08/11 05:53:49 wessels Exp $ + * $Id: comm.cc,v 1.283 1998/08/18 19:13:59 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -104,7 +104,7 @@ u_short comm_local_port(int fd) { struct sockaddr_in addr; - int addr_len = 0; + socklen_t addr_len = 0; fde *F = &fd_table[fd]; /* If the fd is closed already, just return */ @@ -398,7 +398,7 @@ comm_connect_addr(int sock, const struct sockaddr_in *address) { int status = COMM_OK; fde *F = &fd_table[sock]; - int len; + socklen_t len; int x; assert(ntohs(address->sin_port) != 0); /* Establish connection. */ @@ -457,7 +457,7 @@ comm_accept(int fd, struct sockaddr_in *peer, struct sockaddr_in *me) int sock; struct sockaddr_in P; struct sockaddr_in M; - int Slen; + socklen_t Slen; fde *F = NULL; Slen = sizeof(P); if ((sock = accept(fd, (struct sockaddr *) &P, &Slen)) < 0) { diff --git a/src/ftp.cc b/src/ftp.cc index ce497ee69e..2638f8a33d 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.245 1998/08/17 16:44:04 wessels Exp $ + * $Id: ftp.cc,v 1.246 1998/08/18 19:14:01 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1535,7 +1535,7 @@ ftpSendPasv(FtpStateData * ftpState) { int fd; struct sockaddr_in addr; - int addr_len; + socklen_t addr_len; if (ftpState->data.fd >= 0) { if (!ftpState->flags.datachannel_hack) { /* We are already connected, reuse this connection. */ @@ -1660,7 +1660,7 @@ ftpOpenListenSocket(FtpStateData * ftpState, int fallback) { int fd; struct sockaddr_in addr; - int addr_len; + socklen_t addr_len; int on = 1; u_short port = 0; /* @@ -1707,7 +1707,7 @@ ftpSendPort(FtpStateData * ftpState) { int fd; struct sockaddr_in addr; - int addr_len; + socklen_t addr_len; unsigned char *addrptr; unsigned char *portptr; debug(9, 3) ("This is ftpSendPort\n"); diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 36c29f9f38..bb57e95d21 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.cc,v 1.48 1998/08/18 16:00:22 wessels Exp $ + * $Id: icp_v2.cc,v 1.49 1998/08/18 19:14:02 wessels Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -338,7 +338,7 @@ icpHandleUdp(int sock, void *data) { int *N = data; struct sockaddr_in from; - int from_len; + socklen_t from_len; LOCAL_ARRAY(char, buf, SQUID_UDP_SO_RCVBUF); int len; int icp_version; @@ -403,7 +403,7 @@ icpConnectionsOpen(void) struct in_addr addr; struct sockaddr_in xaddr; int x; - int len; + socklen_t len; wordlist *s; if (Config2.Accel.on && !Config.onoff.accel_with_proxy) return; diff --git a/src/ipc.cc b/src/ipc.cc index 3b7fbd39c5..80d33971cd 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.10 1998/08/11 05:53:50 wessels Exp $ + * $Id: ipc.cc,v 1.11 1998/08/18 19:14:03 wessels Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -66,7 +66,7 @@ ipcCreate(int type, const char *prog, char *const args[], const char *name, int int cwfd = -1; int pwfd = -1; int fd; - int len; + socklen_t len; int tmp_s; char *env_str; int x; diff --git a/src/neighbors.cc b/src/neighbors.cc index 9e564009da..b0df3b2ca3 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.232 1998/08/05 07:56:08 wessels Exp $ + * $Id: neighbors.cc,v 1.233 1998/08/18 19:14:05 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -304,7 +304,7 @@ void neighbors_open(int fd) { struct sockaddr_in name; - int len = sizeof(struct sockaddr_in); + socklen_t len = sizeof(struct sockaddr_in); struct servent *sep = NULL; memset(&name, '\0', sizeof(struct sockaddr_in)); if (getsockname(fd, (struct sockaddr *) &name, &len) < 0) diff --git a/src/pinger.cc b/src/pinger.cc index 8e2b32dc01..60db7db16f 100644 --- a/src/pinger.cc +++ b/src/pinger.cc @@ -1,6 +1,6 @@ /* - * $Id: pinger.cc,v 1.36 1998/07/22 20:37:41 wessels Exp $ + * $Id: pinger.cc,v 1.37 1998/08/18 19:14:06 wessels Exp $ * * DEBUG: section 42 ICMP Pinger program * AUTHOR: Duane Wessels @@ -48,6 +48,12 @@ #endif #ifdef _SQUID_LINUX_ +#ifdef icmp_id +#undef icmp_id +#endif +#ifdef icmp_seq +#undef icmp_seq +#endif #define icmp_type type #define icmp_code code #define icmp_cksum checksum @@ -173,7 +179,7 @@ static void pingerRecv(void) { int n; - int fromlen; + socklen_t fromlen; struct sockaddr_in from; int iphdrlen = 20; struct iphdr *ip = NULL; diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 188b63a220..ff19966d01 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,5 +1,5 @@ /* - * $Id: snmp_core.cc,v 1.8 1998/08/14 16:42:03 wessels Exp $ + * $Id: snmp_core.cc,v 1.9 1998/08/18 19:14:08 wessels Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Kostas Anagnostakis @@ -122,7 +122,7 @@ void snmpHandleUdp(int sock, void *not_used) { struct sockaddr_in from; - int from_len; + socklen_t from_len; LOCAL_ARRAY(char, buf, SNMP_REQUEST_SIZE); LOCAL_ARRAY(char, deb_line, 4096); int len; @@ -310,7 +310,7 @@ snmpConnectionOpen(void) u_short port; struct in_addr addr; struct sockaddr_in xaddr; - int len; + socklen_t len; int x; if ((port = Config.Port.snmp) > (u_short) 0) {