]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make FD_SETSIZE inernally signed.
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 30 May 2009 05:24:48 +0000 (17:24 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 30 May 2009 05:24:48 +0000 (17:24 +1200)
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

index e9e8b04d1f16c112e1d3e203d00f10f291f0235a..8ebb448989945bdefa4f25a7c3c171c7994e976d 100644 (file)
@@ -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