mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
BUILD: listener: fix 'for' loop inline variable declaration
commit 16eb0fab3
("MAJOR: counters: dispatch counters over thread groups")
introduced a build regression on some compilers:
src/listener.c: In function 'listener_accept':
src/listener.c:1095:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (int it = 0; it < global.nbtgroups; it++)
^
src/listener.c:1095:3: note: use option -std=c99 or -std=gnu99 to compile your code
src/listener.c:1101:4: error: 'for' loop initial declarations are only allowed in C99 mode
for (int it = 0; it < global.nbtgroups; it++) {
^
make: *** [src/listener.o] Error 1
make: *** Waiting for unfinished jobs....
Let's fix that.
No backport needed
This commit is contained in:
parent
01f011faeb
commit
b5067a972c
@ -1091,14 +1091,15 @@ void listener_accept(struct listener *l)
|
||||
#endif
|
||||
if (p && p->fe_sps_lim) {
|
||||
int max = 0;
|
||||
int it;
|
||||
|
||||
for (int it = 0; it < global.nbtgroups; it++)
|
||||
for (it = 0; it < global.nbtgroups; it++)
|
||||
max += freq_ctr_remain(&p->fe_counters.shared->tg[it]->sess_per_sec, p->fe_sps_lim, 0);
|
||||
|
||||
if (unlikely(!max)) {
|
||||
unsigned int min_wait = 0;
|
||||
|
||||
for (int it = 0; it < global.nbtgroups; it++) {
|
||||
for (it = 0; it < global.nbtgroups; it++) {
|
||||
unsigned int cur_wait = next_event_delay(&p->fe_counters.shared->tg[it]->sess_per_sec, p->fe_sps_lim, 0);
|
||||
if (!it || cur_wait < min_wait)
|
||||
min_wait = cur_wait;
|
||||
|
Loading…
Reference in New Issue
Block a user