]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: listener: fix build warning on global_listener_rwlock without threads
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Nov 2022 08:08:23 +0000 (09:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Nov 2022 08:10:08 +0000 (09:10 +0100)
The global_listener_rwlock was introduced by recent commit 13e86d947
("BUG/MEDIUM: listener: Fix race condition when updating the global mngmt
task"), but it's declared static and is not used when threads are disabled,
thus causing a warning to be emitted in this case. Let's just condition it
to thread usage to shut the warning.

This will need to be backported where the patch above is backported.

src/listener.c

index 6cd365acc81b75fca3a1751c35b382b82c84e278..c94702a04a7e94a882fe3fbcf4388da5164c6ce5 100644 (file)
@@ -47,7 +47,7 @@ struct bind_kw_list bind_keywords = {
 /* list of the temporarily limited listeners because of lack of resource */
 static struct mt_list global_listener_queue = MT_LIST_HEAD_INIT(global_listener_queue);
 static struct task *global_listener_queue_task;
-static HA_RWLOCK_T global_listener_rwlock;
+__decl_thread(static HA_RWLOCK_T global_listener_rwlock);
 
 /* listener status for stats */
 const char* li_status_st[LI_STATE_COUNT] = {