diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/nginx.c | 10 | ||||
| -rw-r--r-- | src/core/ngx_cycle.c | 4 | ||||
| -rw-r--r-- | src/core/ngx_cycle.h | 1 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index 5f2603cfb..766257c8a 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -77,8 +77,6 @@ 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) { @@ -146,6 +144,7 @@ int main(int argc, char *const *argv) } if (ngx_test_config) { + ngx_log_error(NGX_LOG_INFO, cycle->log, 0, "config syntax is ok"); return 0; } @@ -181,7 +180,12 @@ int main(int argc, char *const *argv) #endif - ngx_master_process_cycle(cycle, &ctx); + if (ngx_process == NGX_PROCESS_MASTER) { + ngx_master_process_cycle(cycle, &ctx); + + } else { + ngx_single_process_cycle(cycle, &ctx); + } return 0; } diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index 71a0b0080..94414ae12 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -13,6 +13,8 @@ ngx_array_t ngx_old_cycles; static ngx_pool_t *ngx_temp_pool; static ngx_event_t ngx_cleaner_event; +ngx_uint_t ngx_test_config; + /* STUB NAME */ static ngx_connection_t dumb; @@ -263,7 +265,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) } } - if (!failed) { + if (!ngx_test_config && !failed) { if (ngx_open_listening_sockets(cycle) == NGX_ERROR) { failed = 1; } diff --git a/src/core/ngx_cycle.h b/src/core/ngx_cycle.h index 3cecbc53e..6588a7a15 100644 --- a/src/core/ngx_cycle.h +++ b/src/core/ngx_cycle.h @@ -52,6 +52,7 @@ ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv); extern volatile ngx_cycle_t *ngx_cycle; extern ngx_array_t ngx_old_cycles; extern ngx_module_t ngx_core_module; +extern ngx_uint_t ngx_test_config; #endif /* _NGX_CYCLE_H_INCLUDED_ */ |
