From: W.C.A. Wijngaards Date: Fri, 24 Jul 2026 12:37:17 +0000 (+0200) Subject: - Fix unused variable warnings in shared_ports_fetch_random X-Git-Tag: release-1.26.0rc1~7 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e183c2c506efffef7ea28ee7243bf9d8da6bc542;p=thirdparty%2Funbound.git - Fix unused variable warnings in shared_ports_fetch_random and shared_ports_return_port when compiled without threads. --- diff --git a/doc/Changelog b/doc/Changelog index 6b996cba4..3ed96dcf7 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -19,6 +19,8 @@ parse of the header. - Merge #1480 from petrvaganoff: authzone: fix memory leak in xfer_set_masters() error path. + - Fix unused variable warnings in shared_ports_fetch_random + and shared_ports_return_port when compiled without threads. 23 July 2026: Wouter - Updated credits for Xuanchao Xie in 22 july changelog. diff --git a/services/outside_network.c b/services/outside_network.c index ff197a2e2..24d8f255f 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -4246,6 +4246,9 @@ int shared_ports_fetch_random(struct shared_ports* shp, int portno = 0, my_port = 0; if(!shpif) return 0; +# ifdef THREADS_DISABLED + (void)shp; +# endif lock_basic_lock(&shp->lock); if(udp_connect) { /* if we connect() we cannot reuse fds for a port. */ @@ -4303,6 +4306,9 @@ void shared_ports_return_port(struct shared_ports* shp, #ifndef DISABLE_EXPLICIT_PORT_RANDOMISATION if(!shpif) return; +# ifdef THREADS_DISABLED + (void)shp; +# endif lock_basic_lock(&shp->lock); log_assert(shpif->inuse > 0); shpif->avail_ports[shpif->avail_total - shpif->inuse] = port;