nginx-0.1.0-2004-09-29-00:09:22 import
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 920b601..236a65b 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -95,6 +95,8 @@
ngx_uint_t ngx_max_module;
+ngx_uint_t ngx_use_stderr;
+
int main(int argc, char *const *argv)
{
@@ -116,9 +118,10 @@
ngx_regex_init();
#endif
- log = ngx_log_init_errlog();
ngx_pid = ngx_getpid();
+ log = ngx_log_init_errlog();
+
#if (NGX_OPENSSL)
ngx_ssl_init(log);
#endif
@@ -133,10 +136,6 @@
ctx.argc = argc;
ctx.argv = argv;
- if (ngx_os_init(log) == NGX_ERROR) {
- return 1;
- }
-
if (!(init_cycle.pool = ngx_create_pool(1024, log))) {
return 1;
}
@@ -145,6 +144,14 @@
return 1;
}
+ if (ngx_use_stderr) {
+ log = ngx_log_init_errlog();
+ }
+
+ if (ngx_os_init(log) == NGX_ERROR) {
+ return 1;
+ }
+
if (ngx_add_inherited_sockets(&init_cycle) == NGX_ERROR) {
return 1;
}
@@ -319,6 +326,10 @@
ngx_test_config = 1;
break;
+ case 's':
+ ngx_use_stderr = 1;
+ break;
+
case 'c':
if (ctx->argv[i + 1] == NULL) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,