From: Amos Jeffries Date: Sat, 30 May 2009 05:24:48 +0000 (+1200) Subject: Make FD_SETSIZE inernally signed. X-Git-Tag: SQUID_3_0_STABLE16~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7647abf8454e431bc87a61ffe97a02687dacf37f;p=thirdparty%2Fsquid.git Make FD_SETSIZE inernally signed. FreeBSD 7 defines FD_SETSIZE as unsigned but Squid needs it to be signed to compare it with signed values. Linux and others including FreeBSD <7, define it as signed. If this causes any issues please contact squid-dev@squid-cache.org --- diff --git a/src/squid.h b/src/squid.h index e9e8b04d1f..8ebb448989 100644 --- a/src/squid.h +++ b/src/squid.h @@ -194,13 +194,18 @@ using namespace Squid; /* * Filedescriptor limits in the different select loops + * + * NP: FreeBSD 7 defines FD_SETSIZE as unsigned but Squid needs + * it to be signed to compare it with signed values. + * Linux and others including FreeBSD <7, define it as signed. + * If this causes any issues please contact squid-dev@squid-cache.org */ #if defined(USE_SELECT) || defined(USE_SELECT_WIN32) /* Limited by design */ -# define SQUID_MAXFD_LIMIT FD_SETSIZE +# define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE) #elif defined(USE_POLL) /* Limited due to delay pools */ -# define SQUID_MAXFD_LIMIT FD_SETSIZE +# define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE) #elif defined(USE_KQUEUE) || defined(USE_EPOLL) # define SQUID_FDSET_NOUSE 1 #else