diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-04-18 19:06:02 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-04-18 19:06:02 +0000 |
commit | 9bfb434d241816749077e21f499b8efd41c3625d (patch) | |
tree | defc89b07684b0bd31b77dd61825893e434392ba /src/core/ngx_cycle.c | |
parent | 32075f53e94183c647da58d4d832a58725d36c49 (diff) | |
download | nginx-9bfb434d241816749077e21f499b8efd41c3625d.tar.gz nginx-9bfb434d241816749077e21f499b8efd41c3625d.zip |
nginx-0.0.3-2004-04-18-23:06:02 import
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r-- | src/core/ngx_cycle.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index 94414ae12..bde3171ae 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -138,6 +138,12 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) return NULL; } + if (ngx_test_config) { + ngx_log_error(NGX_LOG_INFO, log, 0, + "the configuration file %s syntax is ok", + cycle->conf_file.data); + } + for (i = 0; ngx_modules[i]; i++) { if (ngx_modules[i]->type != NGX_CORE_MODULE) { @@ -274,10 +280,12 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) #if !(WIN32) - if (dup2(cycle->log->file->fd, STDERR_FILENO) == NGX_ERROR) { - ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, - "dup2(STDERR) failed"); - failed = 1; + if (!failed && !ngx_test_config) { + if (dup2(cycle->log->file->fd, STDERR_FILENO) == NGX_ERROR) { + ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, + "dup2(STDERR) failed"); + failed = 1; + } } #endif @@ -299,6 +307,11 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) } } + if (ngx_test_config) { + ngx_destroy_pool(pool); + return NULL; + } + ls = cycle->listening.elts; for (i = 0; i < cycle->listening.nelts; i++) { if (ls[i].new && ls[i].fd == -1) { |