]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2472. [port] linux: check the number of available cpu's before
authorMark Andrews <marka@isc.org>
Fri, 24 Oct 2008 01:08:21 +0000 (01:08 +0000)
committerMark Andrews <marka@isc.org>
Fri, 24 Oct 2008 01:08:21 +0000 (01:08 +0000)
                        calling chroot as it depends of "/proc". [RT #16923]

CHANGES
bin/named/include/named/globals.h
bin/named/main.c

diff --git a/CHANGES b/CHANGES
index a83ba0c66e34656f730ec2328b935083b6c08ca1..ff08de82413cb04b8402deedd7a54bdf65e3ab29 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2472.  [port]          linux: check the number of available cpu's before
+                       calling chroot as it depends of "/proc". [RT #16923]
+
 2471.  [bug]           named-checkzone was not reporting missing manditory
                        glue when sibling checks were disabled. [RT #18768]
 
index e218d2f05b381f37aa587b0d022cb80f9572ee13..0beef48ba4f8ead112baa70fece79bbd352bc7db 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: globals.h,v 1.76 2008/09/23 17:25:47 jinmei Exp $ */
+/* $Id: globals.h,v 1.77 2008/10/24 01:08:21 marka Exp $ */
 
 #ifndef NAMED_GLOBALS_H
 #define NAMED_GLOBALS_H 1
@@ -48,6 +48,7 @@ EXTERN isc_taskmgr_t *                ns_g_taskmgr            INIT(NULL);
 EXTERN dns_dispatchmgr_t *     ns_g_dispatchmgr        INIT(NULL);
 EXTERN isc_entropy_t *         ns_g_entropy            INIT(NULL);
 EXTERN isc_entropy_t *         ns_g_fallbackentropy    INIT(NULL);
+EXTERN unsigned int            ns_g_cpus_detected      INIT(1);
 
 /*
  * XXXRTH  We're going to want multiple timer managers eventually.  One
index ec65990ff7f10f1cf3fd042f75dda9d3006f517a..5d505f8fd7190a6ef3fc0b5db0dcaf3e31f7e6fb 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: main.c,v 1.164 2008/09/23 17:25:47 jinmei Exp $ */
+/* $Id: main.c,v 1.165 2008/10/24 01:08:21 marka Exp $ */
 
 /*! \file */
 
@@ -490,17 +490,13 @@ static isc_result_t
 create_managers(void) {
        isc_result_t result;
        unsigned int socks;
-#ifdef ISC_PLATFORM_USETHREADS
-       unsigned int cpus_detected;
-#endif
 
 #ifdef ISC_PLATFORM_USETHREADS
-       cpus_detected = isc_os_ncpus();
        if (ns_g_cpus == 0)
-               ns_g_cpus = cpus_detected;
+               ns_g_cpus = ns_g_cpus_detected;
        isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
                      ISC_LOG_INFO, "found %u CPU%s, using %u worker thread%s",
-                     cpus_detected, cpus_detected == 1 ? "" : "s",
+                     ns_g_cpus_detected, ns_g_cpus_detected == 1 ? "" : "s",
                      ns_g_cpus, ns_g_cpus == 1 ? "" : "s");
 #else
        ns_g_cpus = 1;
@@ -633,6 +629,13 @@ setup(void) {
        }
 #endif
 
+#ifdef ISC_PLATFORM_USETHREADS
+       /*
+        * Check for the number of cpu's before ns_os_chroot().
+        */
+       ns_g_cpus_detected = isc_os_ncpus();
+#endif
+
        ns_os_chroot(ns_g_chrootdir);
 
        /*