From 7647abf8454e431bc87a61ffe97a02687dacf37f Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 30 May 2009 17:24:48 +1200 Subject: [PATCH] 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 --- src/squid.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 2.47.2