From: Willy Tarreau Date: Sun, 25 Nov 2018 17:43:29 +0000 (+0100) Subject: MINOR: init: process all initcalls in order at boot time X-Git-Tag: v1.9-dev9~139 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5794fb0c22241f970483a139d3da184e9be14fe8;p=thirdparty%2Fhaproxy.git MINOR: init: process all initcalls in order at boot time main() now iterates over all initcall stages at boot time. This will allow to move init code from constructors to initcalls. --- diff --git a/src/haproxy.c b/src/haproxy.c index 2c42a7096a..184225d95e 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -75,6 +75,7 @@ #include #include #include +#include #include #include #include @@ -2733,6 +2734,15 @@ int main(int argc, char **argv) int pidfd = -1; setvbuf(stdout, NULL, _IONBF, 0); + + /* process all initcalls in order of potential dependency */ + RUN_INITCALLS(STG_PREPARE); + RUN_INITCALLS(STG_LOCK); + RUN_INITCALLS(STG_ALLOC); + RUN_INITCALLS(STG_POOL); + RUN_INITCALLS(STG_REGISTER); + RUN_INITCALLS(STG_INIT); + init(argc, argv); signal_register_fct(SIGQUIT, dump, SIGQUIT); signal_register_fct(SIGUSR1, sig_soft_stop, SIGUSR1);