]> git.pld-linux.org Git - packages/bind.git/commitdiff
- autodetect number of threads even if chroot() is used (so /proc/cpuinfo is not...
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 1 Jun 2007 18:13:47 +0000 (18:13 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bind-chroot-numcpus.patch -> 1.1

bind-chroot-numcpus.patch [new file with mode: 0644]

diff --git a/bind-chroot-numcpus.patch b/bind-chroot-numcpus.patch
new file mode 100644 (file)
index 0000000..97c3026
--- /dev/null
@@ -0,0 +1,49 @@
+diff -urN bind-9.4.1.org/bin/named/main.c bind-9.4.1/bin/named/main.c
+--- bind-9.4.1.org/bin/named/main.c    2007-06-01 19:44:51.223203000 +0200
++++ bind-9.4.1/bin/named/main.c        2007-06-01 20:08:19.703753086 +0200
+@@ -464,9 +464,7 @@
+       }
+ }
+-static isc_result_t
+-create_managers(void) {
+-      isc_result_t result;
++static void fill_ns_g_cpus() {
+ #ifdef ISC_PLATFORM_USETHREADS
+       unsigned int cpus_detected;
+ #endif
+@@ -475,13 +473,20 @@
+       cpus_detected = isc_os_ncpus();
+       if (ns_g_cpus == 0)
+               ns_g_cpus = 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, ns_g_cpus == 1 ? "" : "s");
+ #else
+       ns_g_cpus = 1;
+ #endif
++}
++
++static isc_result_t
++create_managers(void) {
++      isc_result_t result;
++
++#ifdef ISC_PLATFORM_USETHREADS
++      isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
++                    ISC_LOG_INFO, "using %u worker thread%s",
++                    ns_g_cpus, ns_g_cpus == 1 ? "" : "s");
++#endif
+       result = isc_taskmgr_create(ns_g_mctx, ns_g_cpus, 0, &ns_g_taskmgr);
+       if (result != ISC_R_SUCCESS) {
+               UNEXPECTED_ERROR(__FILE__, __LINE__,
+@@ -581,6 +586,9 @@
+               isc_mem_free(ns_g_mctx, instance);
+ #endif /* HAVE_LIBSCF */
++      /* Fill in ns_g_cpus date before chroot happens */
++      fill_ns_g_cpus();
++
+ #ifdef PATH_RANDOMDEV
+       /*
+        * Initialize system's random device as fallback entropy source
This page took 0.037092 seconds and 4 git commands to generate.