- Fix unused variable warnings in shared_ports_fetch_random

and shared_ports_return_port when compiled without threads.
This commit is contained in:
W.C.A. Wijngaards
2026-07-24 14:37:17 +02:00
parent 52b18fc6f5
commit e183c2c506
2 changed files with 8 additions and 0 deletions
+2
View 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.
+6
View 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;