]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: global: don't prevent nbproc from being redefined
authorWilly Tarreau <w@1wt.eu>
Thu, 15 Nov 2012 16:38:15 +0000 (17:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 Nov 2012 16:38:15 +0000 (17:38 +0100)
Having nbproc preinitialized to zero is really annoying as it prevents
some checks from being correctly performed. Also the check to prevent
nbproc from being redefined is totally useless, so let's preset it to
1 and remove the test.

src/cfgparse.c
src/haproxy.c

index d3b630051fb822e887fd4daacc6cd542c08818e7..ec1912ba25c7f0c47f6acb5a32a9180d7167dee0 100644 (file)
@@ -784,11 +784,6 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
        }
        /* end of user/group name handling*/
        else if (!strcmp(args[0], "nbproc")) {
-               if (global.nbproc != 0) {
-                       Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]);
-                       err_code |= ERR_ALERT;
-                       goto out;
-               }
                if (*(args[1]) == 0) {
                        Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]);
                        err_code |= ERR_ALERT | ERR_FATAL;
index 97a40399942b22e40216f86d60228c1df1abf30b..c4122e2d7ca41ff11c47575acb8eb678e4f18cee 100644 (file)
@@ -112,6 +112,7 @@ int  relative_pid = 1;              /* process id starting at 1 */
 
 /* global options */
 struct global global = {
+       .nbproc = 1,
        .req_count = 0,
        .logsrvs = LIST_HEAD_INIT(global.logsrvs),
 #ifdef DEFAULT_MAXZLIBMEM