]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: haproxy: fix compilation on macOS
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 23 Apr 2021 14:41:22 +0000 (16:41 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 23 Apr 2021 14:41:22 +0000 (16:41 +0200)
Fix the warning treated as error on the CI for the macOS compilation :
"src/haproxy.c:2939:23: error: unused variable 'set'
 [-Werror,-Wunused-variable]"

This does not need to be backported.

src/haproxy.c

index b89c51779f28fc56a04c2695efdd9a5dc802101b..e19b8148a72e8949b1436a3c80de708a9fc15876 100644 (file)
@@ -2936,10 +2936,11 @@ int main(int argc, char **argv)
                    proc < MAX_PROCS &&       /* only the first 32/64 processes may be pinned */
                    ha_cpuset_count(&global.cpu_map.proc[proc])) {   /* only do this if the process has a CPU map */
 
-                       struct hap_cpuset *set = &global.cpu_map.proc[proc];
 #ifdef __FreeBSD__
+                       struct hap_cpuset *set = &global.cpu_map.proc[proc];
                        ret = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(set->cpuset), &set->cpuset);
 #elif defined(__linux__) || defined(__DragonFly__)
+                       struct hap_cpuset *set = &global.cpu_map.proc[proc];
                        sched_setaffinity(0, sizeof(set->cpuset), &set->cpuset);
 #endif
                }