]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: vars: move the per-process variables initialization to vars.c
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Feb 2022 15:47:03 +0000 (16:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Feb 2022 16:11:33 +0000 (17:11 +0100)
There's no point keeping the vars_init_head() call in init() when we
already have a vars_init() registered at the right time to do that,
and it complexifies the boot sequence, so let's move it there.

src/haproxy.c
src/vars.c

index 6f591d6ffff5d33b2c49d400a72c6e910857c2f4..4d95ae6eb440ccce3400837e2c69ef593a61725c 100644 (file)
@@ -1540,9 +1540,6 @@ static void init(int argc, char **argv)
        /* Initialise lua. */
        hlua_init();
 
-       /* Initialize process vars */
-       vars_init_head(&proc_vars, SCOPE_PROC);
-
        global.tune.options |= GTUNE_USE_SELECT;  /* select() is always available */
 #if defined(USE_POLL)
        global.tune.options |= GTUNE_USE_POLL;
index 4ed3a1d058c9eae73eed59a05af21d238dc21f5b..e620acf3aea7286874c932b790d911fd82483108 100644 (file)
@@ -1335,6 +1335,8 @@ static int vars_max_size_check(char **args, int section_type, struct proxy *curp
 static void vars_init()
 {
        var_name_hash_seed = ha_random64();
+       /* Initialize process vars */
+       vars_init_head(&proc_vars, SCOPE_PROC);
 }
 
 INITCALL0(STG_PREPARE, vars_init);