From b2620634c5c395f227a98837f46e1eaf6b86963c Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 10 Jan 2003 06:09:20 +0000 Subject: nginx-0.0.1-2003-01-10-09:09:20 import --- src/core/nginx.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/core/nginx.c') diff --git a/src/core/nginx.c b/src/core/nginx.c index ead14530a..5652e4167 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -3,6 +3,7 @@ #include +#include #include #include #include @@ -41,6 +42,7 @@ ngx_array_t ngx_listening_sockets; int main(int argc, char *const *argv) { + int i; ngx_str_t conf_file; ngx_conf_t conf; @@ -70,9 +72,18 @@ int main(int argc, char *const *argv) conf_file.data = "nginx.conf"; if (ngx_conf_parse(&conf, &conf_file) != NGX_CONF_OK) { - exit(1); + return 1; + } + + for (i = 0; ngx_modules[i]; i++) { + if (ngx_modules[i]->init_module) { + if (ngx_modules[i]->init_module(ngx_pool) == NGX_ERROR) { + return 1; + } + } } + #if 0 /* STUB */ /* TODO: init chain of global modules (like ngx_http.c), -- cgit