]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cfgparse: diag for multiple nbthread statements
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 29 Mar 2021 08:41:15 +0000 (10:41 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 1 Apr 2021 16:03:37 +0000 (18:03 +0200)
Output a diagnostic report if the nbthread statement is defined on
several places in the configuration.

src/cfgparse-global.c

index 72b11c033063a2457bc6f68b6a1a77bba4b4660c..e0762478bb2f89c4884b4c83bb1cdff56856b378 100644 (file)
@@ -579,6 +579,11 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                        err_code |= ERR_ALERT | ERR_FATAL;
                        goto out;
                }
+
+               HA_DIAG_WARNING_COND(global.nbthread,
+                                    "parsing [%s:%d] : nbthread is already defined and will be overridden.\n",
+                                    file, linenum);
+
                global.nbthread = parse_nbthread(args[1], &errmsg);
                if (!global.nbthread) {
                        ha_alert("parsing [%s:%d] : '%s' %s.\n",