diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-09-05 19:54:02 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-09-05 19:54:02 +0000 |
commit | 980a92472cc30271ad7e88eb2dcc43f00e984d4d (patch) | |
tree | b8940cd9e6b8859c78e3c023c1373bae02371f2e /src/core/ngx_log.c | |
parent | b9e344175f4e971284aa14c8fe685936a4957d52 (diff) | |
download | nginx-980a92472cc30271ad7e88eb2dcc43f00e984d4d.tar.gz nginx-980a92472cc30271ad7e88eb2dcc43f00e984d4d.zip |
nginx-0.0.10-2004-09-05-23:54:02 import
Diffstat (limited to 'src/core/ngx_log.c')
-rw-r--r-- | src/core/ngx_log.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index 7638b6a70..a3f6e77cb 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -37,8 +37,8 @@ ngx_module_t ngx_errlog_module = { }; -static ngx_open_file_t ngx_stderr; static ngx_log_t ngx_log; +static ngx_open_file_t ngx_stderr; static const char *err_levels[] = { @@ -296,8 +296,13 @@ ngx_log_t *ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_array_t *args) name = NULL; } - ngx_test_null(log, ngx_pcalloc(cycle->pool, sizeof(ngx_log_t)), NULL); - ngx_test_null(log->file, ngx_conf_open_file(cycle, name), NULL); + if (!(log = ngx_pcalloc(cycle->pool, sizeof(ngx_log_t)))) { + return NULL; + } + + if (!(log->file = ngx_conf_open_file(cycle, name))) { + return NULL; + } return log; } @@ -363,7 +368,9 @@ static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) value = cf->args->elts; if (value[1].len == 6 && ngx_strcmp(value[1].data, "stderr") == 0) { - cf->cycle->new_log->file = &ngx_stderr; + cf->cycle->new_log->file->fd = ngx_stderr.fd; + cf->cycle->new_log->file->name.len = 0; + cf->cycle->new_log->file->name.data = NULL; } else { cf->cycle->new_log->file->name = value[1]; |