]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: init: remove useless assignment of nbthread
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Dec 2022 07:13:20 +0000 (08:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Dec 2022 07:14:35 +0000 (08:14 +0100)
The old test consisting in setting global.nbthread if lower than 1
is useless nowadays since it's already done in check_config_validity().

src/haproxy.c

index 7e67f001cd0a7247e79b1fe4c7eafc5e4b02dec9..178f2748487c025f77e2839bdcc1d7594a25fd7e 100644 (file)
@@ -2227,6 +2227,7 @@ static void init(int argc, char **argv)
                exit(1);
        }
 
+       /* Note: global.nbthread will be initialized as part of this call */
        err_code |= check_config_validity();
        for (px = proxies_list; px; px = px->next) {
                struct server *srv;
@@ -2598,9 +2599,6 @@ static void init(int argc, char **argv)
                global.mode &= ~(MODE_DAEMON | MODE_QUIET);
        }
 
-       if (global.nbthread < 1)
-               global.nbthread = 1;
-
        /* Realloc trash buffers because global.tune.bufsize may have changed */
        if (!init_trash_buffers(0)) {
                ha_alert("failed to initialize trash buffers.\n");