]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix unused variable warnings in shared_ports_fetch_random
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 24 Jul 2026 12:37:17 +0000 (14:37 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 24 Jul 2026 12:37:17 +0000 (14:37 +0200)
  and shared_ports_return_port when compiled without threads.

doc/Changelog
services/outside_network.c

index 6b996cba46a1317cdae979b50fcf1f404aa8bcca..3ed96dcf7b1514cf315f45c35415fc777a730176 100644 (file)
@@ -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.
index ff197a2e2f0eb49b78bfdc43704d4b6b2777fb0f..24d8f255faa791d855f0385cc34e3cbf6add4b9e 100644 (file)
@@ -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;