]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: haproxy: always initialize sleeping_thread_mask
authorWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2020 16:24:53 +0000 (17:24 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2020 18:09:46 +0000 (19:09 +0100)
Surprizingly the variable was never initialized, though on most
platforms it's zeroed at boot, and it is relatively harmless
anyway since in the worst case the bits are updated around poll().

This was introduced by commit 79321b95a85 and needs to be backported
as far as 1.9.

src/haproxy.c

index 29c65f592226f9e2cd89f4b3b61aa8ff1131b51f..64da497b0861d335a610f66d77302cc5e37e2c46 100644 (file)
@@ -145,7 +145,8 @@ int  relative_pid = 1;              /* process id starting at 1 */
 unsigned long pid_bit = 1;      /* bit corresponding to the process id */
 unsigned long all_proc_mask = 1; /* mask of all processes */
 
-volatile unsigned long sleeping_thread_mask; /* Threads that are about to sleep in poll() */
+volatile unsigned long sleeping_thread_mask = 0; /* Threads that are about to sleep in poll() */
+
 /* global options */
 struct global global = {
        .hard_stop_after = TICK_ETERNITY,