diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-04-15 15:34:36 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-04-15 15:34:36 +0000 |
commit | 68df19d33ac5cf804650261867afd5f8acdce364 (patch) | |
tree | 5a49e42b41da04ea73eec12d0f402730e3268ca1 /src/core/nginx.c | |
parent | cccc5528945be46d6afb456e7aba751340af9089 (diff) | |
download | nginx-68df19d33ac5cf804650261867afd5f8acdce364.tar.gz nginx-68df19d33ac5cf804650261867afd5f8acdce364.zip |
nginx-0.0.3-2004-04-15-19:34:36 import
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r-- | src/core/nginx.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index a784040a7..5f2603cfb 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -70,12 +70,14 @@ ngx_module_t ngx_core_module = { }; -ngx_int_t ngx_max_module; +ngx_int_t ngx_max_module; -ngx_int_t ngx_process; -ngx_pid_t ngx_pid; -ngx_pid_t ngx_new_binary; -ngx_int_t ngx_inherited; +ngx_int_t ngx_process; +ngx_pid_t ngx_pid; +ngx_pid_t ngx_new_binary; +ngx_int_t ngx_inherited; + +ngx_uint_t ngx_test_config; int main(int argc, char *const *argv) @@ -125,11 +127,6 @@ int main(int argc, char *const *argv) return 1; } - ngx_max_module = 0; - for (i = 0; ngx_modules[i]; i++) { - ngx_modules[i]->index = ngx_max_module++; - } - if (!(init_cycle.pool = ngx_create_pool(1024, log))) { return 1; } @@ -138,11 +135,20 @@ int main(int argc, char *const *argv) return 1; } + ngx_max_module = 0; + for (i = 0; ngx_modules[i]; i++) { + ngx_modules[i]->index = ngx_max_module++; + } + cycle = ngx_init_cycle(&init_cycle); if (cycle == NULL) { return 1; } + if (ngx_test_config) { + return 0; + } + ngx_cycle = cycle; ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); @@ -276,6 +282,10 @@ static ngx_int_t ngx_getopt(ngx_master_ctx_t *ctx, ngx_cycle_t *cycle) switch (ctx->argv[i][1]) { + case 't': + ngx_test_config = 1; + break; + case 'c': if (ctx->argv[i + 1] == NULL) { ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, |