]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] improve thread support reporting
authorEvan Hunt <each@isc.org>
Wed, 4 Mar 2015 23:56:33 +0000 (15:56 -0800)
committerEvan Hunt <each@isc.org>
Wed, 4 Mar 2015 23:56:33 +0000 (15:56 -0800)
4083. [cleanup] Print of the number of CPUs and UDP listeners
in the log and in "rndc status" output; indicate
whether threads are supported in "named -V" output.
[RT #38811]

CHANGES
bin/named/main.c
bin/named/server.c
lib/dns/geoip.c

diff --git a/CHANGES b/CHANGES
index 0ee653891df6def2ca3033ea86d492768eb856c5..76562e1d65d9a8359c18850dc3b1e13bd598da85 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+4083.  [cleanup]       Print of the number of CPUs and UDP listeners
+                       in the log and in "rndc status" output; indicate
+                       whether threads are supported in "named -V" output.
+                       [RT #38811]
+
 4082.  [bug]           Incrementally sign large inline zone deltas.
                        [RT #37927]
 
index a1bccce721c7ba03122099269a5aab5465976205..60ceb4721f5367fdb4e799baedfd30720aa3c542 100644 (file)
@@ -670,6 +670,11 @@ parse_command_line(int argc, char *argv[]) {
                               JSON_C_VERSION);
                        printf("linked to libjson-c version: %s\n",
                               json_c_version());
+#endif
+#ifdef ISC_PLATFORM_USETHREADS
+                       printf("threads support is enabled\n");
+#else
+                       printf("threads support is disabled\n");
 #endif
                        exit(0);
                case 'x':
@@ -742,9 +747,11 @@ create_managers(void) {
        if (ns_g_udpdisp > ns_g_cpus)
                ns_g_udpdisp = ns_g_cpus;
 #endif
+#ifdef ISC_PLATFORM_USETHREADS
        isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
                      ISC_LOG_INFO, "using %u UDP listener%s per interface",
                      ns_g_udpdisp, ns_g_udpdisp == 1 ? "" : "s");
+#endif
 
        result = isc_taskmgr_create(ns_g_mctx, ns_g_cpus, 0, &ns_g_taskmgr);
        if (result != ISC_R_SUCCESS) {
index 08fd750dc1887dd4e49b2789898c13405d0c20df..63d46cd4a5dcedec5c551a259151c0693aad3797 100644 (file)
@@ -8459,8 +8459,11 @@ ns_server_status(ns_server_t *server, isc_buffer_t **text) {
        snprintf(line, sizeof(line), "UDP listeners per interface: %u\n",
                 ns_g_udpdisp);
        CHECK(putstr(text, line));
-
+#else
+       snprintf(line, sizeof(line), "CPUs found: N/A (threads disabled)\n");
+       CHECK(putstr(text, line));
 #endif
+
        snprintf(line, sizeof(line), "number of zones: %u (%u automatic)\n",
                     zonecount, automatic);
        CHECK(putstr(text, line));
index 40a5c0824033aa5294898897a915c3b3e1b7772c..c018f5e042623f1a3983ce8a19f6c494f89e6db3 100644 (file)
@@ -137,7 +137,7 @@ state_key_init(void) {
        return (result);
 }
 #else
-geoip_state_t prev_state;
+static geoip_state_t saved_state;
 #endif
 
 static void
@@ -193,7 +193,7 @@ set_state(unsigned int family, isc_uint32_t ipnum, const geoipv6_t *ipnum6,
        } else
                clean_state(state);
 #else
-       state = &prev_state;
+       state = &saved_state;
        clean_state(state);
 #endif
 
@@ -231,7 +231,7 @@ get_state_for(unsigned int family, isc_uint32_t ipnum,
        if (state == NULL)
                return (NULL);
 #else
-       state = &prev_state;
+       state = &saved_state;
 #endif
 
        if (state->family == family &&