]> git.kaiwu.me - nginx.git/commitdiff
nginx did not close log file set by --error-log-path,
authorIgor Sysoev <igor@sysoev.ru>
Fri, 9 Oct 2009 14:43:09 +0000 (14:43 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 9 Oct 2009 14:43:09 +0000 (14:43 +0000)
the bug was introduced in r2744

src/core/nginx.c

index eaae62e4bbe459c2addb053dc78471d876e5507e..29eee6a9981a928478bf67c5968e42ac377f51df 100644 (file)
@@ -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) {