comparison src/core/nginx.c @ 444:42d11f017717

nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
author Igor Sysoev <igor@sysoev.ru>
date Wed, 29 Sep 2004 16:00:49 +0000
parents 33aec431094b
children 241dc8092a33
comparison
equal deleted inserted replaced
443:33aec431094b 444:42d11f017717
1 1
2 /* 2 /*
3 * Copyright (C) 2002-2004 Igor Sysoev 3 * Copyright (C) Igor Sysoev
4 */ 4 */
5 5
6 6
7 #include <ngx_config.h> 7 #include <ngx_config.h>
8 #include <ngx_core.h> 8 #include <ngx_core.h>
93 }; 93 };
94 94
95 95
96 ngx_uint_t ngx_max_module; 96 ngx_uint_t ngx_max_module;
97 97
98 ngx_uint_t ngx_use_stderr;
99
100 98
101 int main(int argc, char *const *argv) 99 int main(int argc, char *const *argv)
102 { 100 {
103 ngx_int_t i; 101 ngx_int_t i;
104 ngx_log_t *log; 102 ngx_log_t *log;
118 ngx_regex_init(); 116 ngx_regex_init();
119 #endif 117 #endif
120 118
121 ngx_pid = ngx_getpid(); 119 ngx_pid = ngx_getpid();
122 120
123 log = ngx_log_init_errlog(); 121 if (!(log = ngx_log_init_errlog())) {
122 return 1;
123 }
124 124
125 #if (NGX_OPENSSL) 125 #if (NGX_OPENSSL)
126 ngx_ssl_init(log); 126 ngx_ssl_init(log);
127 #endif 127 #endif
128 128
140 return 1; 140 return 1;
141 } 141 }
142 142
143 if (ngx_getopt(&ctx, &init_cycle) == NGX_ERROR) { 143 if (ngx_getopt(&ctx, &init_cycle) == NGX_ERROR) {
144 return 1; 144 return 1;
145 }
146
147 if (ngx_use_stderr) {
148 log = ngx_log_init_errlog();
149 } 145 }
150 146
151 if (ngx_os_init(log) == NGX_ERROR) { 147 if (ngx_os_init(log) == NGX_ERROR) {
152 return 1; 148 return 1;
153 } 149 }
322 318
323 switch (ctx->argv[i][1]) { 319 switch (ctx->argv[i][1]) {
324 320
325 case 't': 321 case 't':
326 ngx_test_config = 1; 322 ngx_test_config = 1;
327 break;
328
329 case 's':
330 ngx_use_stderr = 1;
331 break; 323 break;
332 324
333 case 'c': 325 case 'c':
334 if (ctx->argv[i + 1] == NULL) { 326 if (ctx->argv[i + 1] == NULL) {
335 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, 327 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,