]>
Commit | Line | Data |
---|---|---|
22fb5926 AM |
1 | diff -urN bind-9.4.1.org/bin/named/main.c bind-9.4.1/bin/named/main.c |
2 | --- bind-9.4.1.org/bin/named/main.c 2007-06-01 19:44:51.223203000 +0200 | |
3 | +++ bind-9.4.1/bin/named/main.c 2007-06-01 20:08:19.703753086 +0200 | |
4 | @@ -464,9 +464,7 @@ | |
5 | } | |
6 | } | |
7 | ||
8 | -static isc_result_t | |
9 | -create_managers(void) { | |
10 | - isc_result_t result; | |
11 | +static void fill_ns_g_cpus() { | |
12 | #ifdef ISC_PLATFORM_USETHREADS | |
13 | unsigned int cpus_detected; | |
14 | #endif | |
15 | @@ -475,13 +473,20 @@ | |
16 | cpus_detected = isc_os_ncpus(); | |
17 | if (ns_g_cpus == 0) | |
18 | ns_g_cpus = cpus_detected; | |
19 | - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, | |
20 | - ISC_LOG_INFO, "found %u CPU%s, using %u worker thread%s", | |
21 | - cpus_detected, cpus_detected == 1 ? "" : "s", | |
22 | - ns_g_cpus, ns_g_cpus == 1 ? "" : "s"); | |
23 | #else | |
24 | ns_g_cpus = 1; | |
25 | #endif | |
26 | +} | |
27 | + | |
28 | +static isc_result_t | |
29 | +create_managers(void) { | |
30 | + isc_result_t result; | |
31 | + | |
32 | +#ifdef ISC_PLATFORM_USETHREADS | |
33 | + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, | |
34 | + ISC_LOG_INFO, "using %u worker thread%s", | |
35 | + ns_g_cpus, ns_g_cpus == 1 ? "" : "s"); | |
36 | +#endif | |
37 | result = isc_taskmgr_create(ns_g_mctx, ns_g_cpus, 0, &ns_g_taskmgr); | |
38 | if (result != ISC_R_SUCCESS) { | |
39 | UNEXPECTED_ERROR(__FILE__, __LINE__, | |
40 | @@ -581,6 +586,9 @@ | |
41 | isc_mem_free(ns_g_mctx, instance); | |
42 | #endif /* HAVE_LIBSCF */ | |
43 | ||
44 | + /* Fill in ns_g_cpus date before chroot happens */ | |
45 | + fill_ns_g_cpus(); | |
46 | + | |
47 | #ifdef PATH_RANDOMDEV | |
48 | /* | |
49 | * Initialize system's random device as fallback entropy source |