]> git.kaiwu.me - nginx.git/commitdiff
merge r3200:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 1 Feb 2010 14:44:43 +0000 (14:44 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 1 Feb 2010 14:44:43 +0000 (14:44 +0000)
nginx did not close log file set by --error-log-path,
the bug was introduced in r2744

src/core/nginx.c

index a9951d3a23a5a3256a5c39ee3b99c12a90e86c40..5df96a4385ed954c83f61756c0f70a77e6b3964d 100644 (file)
@@ -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) {