]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: remove for loop declaration
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 5 Oct 2020 14:57:33 +0000 (16:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 5 Oct 2020 15:55:40 +0000 (17:55 +0200)
Remove variable declaration inside a for-loop. This was introduced by my
patches serie of the implementation of dynamic stats. This is not
supported by older gcc, notably on the freebsd environment of the ci.

src/stats.c

index aa3fe8b4a0a8b281e944fcadf2bc2e54db5afb5e..8752788ba116f181fe03442f7c4e51d4f40af37c 100644 (file)
@@ -4421,6 +4421,7 @@ static int allocate_stats_px_postcheck(void)
        struct stats_module *mod;
        size_t i = ST_F_TOTAL_FIELDS;
        int err_code = 0;
+       struct proxy *px;
 
        stat_count[STATS_DOMAIN_PROXY] += ST_F_TOTAL_FIELDS;
 
@@ -4441,7 +4442,7 @@ static int allocate_stats_px_postcheck(void)
                i += mod->stats_count;
        }
 
-       for (struct proxy *px = proxies_list; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if (!stats_allocate_proxy_counters(px)) {
                        ha_alert("stats: cannot allocate all counters for proxy statistics\n");
                        err_code |= ERR_ALERT | ERR_FATAL;