From: W.C.A. Wijngaards Date: Tue, 2 Jul 2024 07:44:58 +0000 (+0200) Subject: - Fix compile warning in worker pthread id printout. X-Git-Tag: release-1.21.0rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fe4e2ec3eb1826d943ef90537c1cdefba6cfcce;p=thirdparty%2Funbound.git - Fix compile warning in worker pthread id printout. --- diff --git a/daemon/stats.c b/daemon/stats.c index 4855bf1c1..827110698 100644 --- a/daemon/stats.c +++ b/daemon/stats.c @@ -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 ); diff --git a/doc/Changelog b/doc/Changelog index 92a5d8913..101e80754 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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.