From: Willy Tarreau Date: Thu, 15 Nov 2012 16:38:15 +0000 (+0100) Subject: MINOR: global: don't prevent nbproc from being redefined X-Git-Tag: v1.5-dev13~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=247a13a3157bbfeb5760dd12a5e4c8624495b25c;p=thirdparty%2Fhaproxy.git MINOR: global: don't prevent nbproc from being redefined 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. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index d3b630051f..ec1912ba25 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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; diff --git a/src/haproxy.c b/src/haproxy.c index 97a4039994..c4122e2d7c 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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