]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Joshua Root <josh+squid@root.id.au>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 15 May 2008 13:30:53 +0000 (07:30 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 15 May 2008 13:30:53 +0000 (07:30 -0600)
Bug 2204: configure fails to detect max open files

The behaviour of setrusage has changed in Mac OS X 10.5.

configure.in

index eac737b4aa6374d239e700f0066a5b6d4fed16fc..0be00547de420dea0c16911d6203f48106ae8b09 100644 (file)
@@ -2958,7 +2958,12 @@ main() {
     if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
         perror("getrlimit: RLIMIT_NOFILE");
     } else {
+#if defined(__APPLE__)
+        /* asking for more than OPEN_MAX fails on Leopard */
+        rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
+#else
         rl.rlim_cur = rl.rlim_max;      /* set it to the max */
+#endif
         if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
             perror("setrlimit: RLIMIT_NOFILE");
         }