summaryrefslogtreecommitdiff
path: root/src/core/ngx_cycle.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-05-01 18:53:04 +0000
committerJonathan Kolb <jon@b0g.us>2009-05-01 18:53:04 +0000
commit1a537756bb9d3018ea6ab099b22e9734cc8a879d (patch)
tree6d2fe235b46b0de3053db6c84739db4f34e674e7 /src/core/ngx_cycle.c
parentb04081c3ce5d031367a0142d57e287e26ba2e415 (diff)
downloadnginx-0.7.54.tar.gz
Changes with nginx 0.7.54 01 May 2009v0.7.54
*) Feature: the ngx_http_image_filter_module. *) Feature: the "proxy_ignore_headers" and "fastcgi_ignore_headers" directives. *) Bugfix: a segmentation fault might occur in worker process, if an "open_file_cache_errors off" directive was used; the bug had appeared in 0.7.53. *) Bugfix: the "port_in_redirect off" directive did not work; the bug had appeared in 0.7.39. *) Bugfix: improve handling of "select" method errors. *) Bugfix: of "select() failed (10022: ...)" error in nginx/Windows. *) Bugfix: in error text descriptions in nginx/Windows; the bug had appeared in 0.7.53.
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r--src/core/ngx_cycle.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 10d07714b..251892b74 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -82,6 +82,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
cycle->pool = pool;
cycle->log = log;
+ cycle->new_log.log_level = NGX_LOG_ERR;
cycle->old_cycle = old_cycle;
cycle->conf_prefix.len = old_cycle->conf_prefix.len;
@@ -165,14 +166,6 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
return NULL;
}
-
- cycle->new_log = ngx_log_create_errlog(cycle, &error_log);
- if (cycle->new_log == NULL) {
- ngx_destroy_pool(pool);
- return NULL;
- }
-
-
n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10;
cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t));
@@ -336,6 +329,13 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
}
+ if (cycle->new_log.file == NULL) {
+ cycle->new_log.file = ngx_conf_open_file(cycle, &error_log);
+ if (cycle->new_log.file == NULL) {
+ goto failed;
+ }
+ }
+
/* open the new files */
part = &cycle->open_files.part;
@@ -382,12 +382,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
#endif
}
- cycle->log = cycle->new_log;
- pool->log = cycle->new_log;
-
- if (cycle->log->log_level == 0) {
- cycle->log->log_level = NGX_LOG_ERR;
- }
+ cycle->log = &cycle->new_log;
+ pool->log = &cycle->new_log;
/* create shared memory */
@@ -1126,7 +1122,9 @@ ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user)
if (user != (ngx_uid_t) NGX_CONF_UNSET_UINT) {
ngx_file_info_t fi;
- if (ngx_file_info((const char *) file[i].name.data, &fi) == -1) {
+ if (ngx_file_info((const char *) file[i].name.data, &fi)
+ == NGX_FILE_ERROR)
+ {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
ngx_file_info_n " \"%s\" failed",
file[i].name.data);