changeset 3432:20871c5e1d5d stable-0.7

merge r3200: nginx did not close log file set by --error-log-path, the bug was introduced in r2744
author Igor Sysoev <igor@sysoev.ru>
date Mon, 01 Feb 2010 14:44:43 +0000
parents 4edce2b6b285
children 6b8284fc958d
files src/core/nginx.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -380,6 +380,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) {