Mercurial > hg > nginx
diff src/core/nginx.c @ 100:7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 03 Jun 2003 15:42:58 +0000 |
parents | c9b243802a17 |
children | 6dfda4cf5200 |
line wrap: on
line diff
--- a/src/core/nginx.c Mon Jun 02 15:24:30 2003 +0000 +++ b/src/core/nginx.c Tue Jun 03 15:42:58 2003 +0000 @@ -31,21 +31,25 @@ int main(int argc, char *const *argv) { int i; - ngx_str_t conf_file; - ngx_conf_t conf; + ngx_str_t conf_file; + ngx_log_t *log; + ngx_conf_t conf; ngx_max_sockets = -1; +#if 0 ngx_log.fd = STDERR_FILENO; ngx_log.log_level = NGX_LOG_INFO; /* STUB */ ngx_log.log_level = NGX_LOG_DEBUG; +#endif + log = ngx_log_init_errlog(); - if (ngx_os_init(&ngx_log) == NGX_ERROR) { + if (ngx_os_init(log) == NGX_ERROR) { return 1; } - ngx_pool = ngx_create_pool(16 * 1024, &ngx_log); + ngx_pool = ngx_create_pool(16 * 1024, log); /* */ ngx_max_module = 0; @@ -72,7 +76,7 @@ conf.ctx = ngx_conf_ctx; conf.pool = ngx_pool; - conf.log = &ngx_log; + conf.log = log; conf.module_type = NGX_CORE_MODULE; conf.cmd_type = NGX_MAIN_CONF; @@ -83,6 +87,11 @@ return 1; } +#if 0 + log = (ngx_log_t *) ngx_get_conf(ngx_errlog_module); + /* STUB */ log->log_level = NGX_LOG_DEBUG; +#endif + ngx_init_temp_number(); ngx_io = ngx_os_io; @@ -95,7 +104,7 @@ } } - if (ngx_open_listening_sockets(&ngx_log) == NGX_ERROR) { + if (ngx_open_listening_sockets(log) == NGX_ERROR) { return 1; } @@ -103,12 +112,12 @@ /* TODO: fork */ - ngx_pre_thread(&ngx_listening_sockets, ngx_pool, &ngx_log); + ngx_pre_thread(&ngx_listening_sockets, ngx_pool, log); /* TODO: threads */ /* STUB */ - ngx_worker(&ngx_log); + ngx_worker(log); } return 0;