]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix compile warning in worker pthread id printout.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Jul 2024 07:44:58 +0000 (09:44 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Jul 2024 07:44:58 +0000 (09:44 +0200)
daemon/stats.c
doc/Changelog

index 4855bf1c1d2dd58833fd4377642c62707a4489f6..827110698970e17e0bdbb265bad40b79abc98592 100644 (file)
@@ -391,6 +391,13 @@ void server_stats_obtain(struct worker* worker, struct worker* who,
        else    worker_send_cmd(who, worker_cmd_stats_noreset);
        verbose(VERB_ALGO, "wait for stats reply");
        if(tube_wait_timeout(worker->cmd, STATS_THREAD_WAIT) == 0) {
+#if defined(HAVE_PTHREAD) && defined(SIZEOF_PTHREAD_T) && defined(SIZEOF_UNSIGNED_LONG)
+#  if SIZEOF_PTHREAD_T == SIZEOF_UNSIGNED_LONG
+               unsigned long pthid = 0;
+               if(verbosity >= VERB_OPS)
+                       memcpy(&pthid, &who->thr_id, sizeof(unsigned long));
+#  endif
+#endif
                verbose(VERB_OPS, "no response from thread %d"
 #ifdef HAVE_GETTID
                        " LWP %u"
@@ -407,7 +414,7 @@ void server_stats_obtain(struct worker* worker, struct worker* who,
 #endif
 #if defined(HAVE_PTHREAD) && defined(SIZEOF_PTHREAD_T) && defined(SIZEOF_UNSIGNED_LONG)
 #  if SIZEOF_PTHREAD_T == SIZEOF_UNSIGNED_LONG
-                       , (unsigned long)*((unsigned long*)&who->thr_id)
+                       , pthid
 #  endif
 #endif
                        );
index 92a5d891392180704ea54acf221485beed6cf913..101e807541907904e9cc64f78aad2b6710b26bb4 100644 (file)
@@ -1,6 +1,7 @@
 2 July 2024: Wouter
        - Fix to remove unused include from the readzone test program.
        - Fix unused variable warning in do_cache_remove.
+       - Fix compile warning in worker pthread id printout.
 
 17 June 2024: Wouter
        - Fix ip-ratelimit-cookie setting, it was not applied.