From e7138540d603336a0f2187d8cf20d24b54ed265e Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 9 Oct 2009 14:43:09 +0000 Subject: nginx did not close log file set by --error-log-path, the bug was introduced in r2744 --- src/core/nginx.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core') diff --git a/src/core/nginx.c b/src/core/nginx.c index eaae62e4b..29eee6a99 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -376,6 +376,13 @@ main(int argc, char *const *argv) } } + if (log->file->fd != ngx_stderr) { + if (ngx_close_file(log->file->fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + ngx_close_file_n " built-in log failed"); + } + } + ngx_use_stderr = 0; if (ngx_process == NGX_PROCESS_SINGLE) { -- cgit