From: hno <> Date: Sat, 13 Sep 2003 14:32:39 +0000 (+0000) Subject: From 2.5: Make SQUID_MAXFD always an multiple of 64 to guarantee there is no rounding X-Git-Tag: SQUID_3_0_PRE4~1211 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a4d7e961fbbb97a65961535f2eccd715150ee25b;p=thirdparty%2Fsquid.git From 2.5: Make SQUID_MAXFD always an multiple of 64 to guarantee there is no rounding errors in bitfield arithmetics of the fd_set macros. For example GLIBC has bugs causing a fd_set overflow if the size is not an even multiple of a machie word (64 bits on 64 bit platforms) --- diff --git a/configure.in b/configure.in index b52e346748..457dae7c4e 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ 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.348 2003/09/02 10:52:37 hno Exp $ +dnl $Id: configure.in,v 1.349 2003/09/13 08:32:39 hno Exp $ dnl dnl dnl @@ -13,7 +13,7 @@ AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE(squid, 3.0-PRE3-CVS) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.348 $)dnl +AC_REVISION($Revision: 1.349 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -2241,7 +2241,7 @@ main() { i++; #endif /* IF !DEF CYGWIN */ fp = fopen("conftestval", "w"); - fprintf (fp, "%d\n", i); + fprintf (fp, "%d\n", i & ~0x3F); exit(0); } ], @@ -2260,6 +2260,12 @@ if test "$SQUID_MAXFD" -lt 512 ; then fi LDFLAGS="$TLDFLAGS" +if test `expr $SQUID_MAXFD % 63` != 0; then + echo "WARNING: $SQUID_MAXFD is not an multiple of 64. This may cause issues" + echo " on certain platforms." + sleep 10 +fi + dnl Not cached since people are likely to tune this AC_MSG_CHECKING(Default UDP send buffer size) AC_TRY_RUN([