b74969
From 9f6ca9bc6400fc9c8eaebf963f6eb048dde4b34f Mon Sep 17 00:00:00 2001
b74969
From: Remi Collet <remi@php.net>
b74969
Date: Fri, 24 May 2013 12:09:05 +0200
b74969
Subject: [PATCH] Fixed Bug #64915 (error_log ignored when daemonize=0)
b74969
b74969
Use configured error_log file when stderr is not a tty.
b74969
So only use tty during interactive debug run.
b74969
---
b74969
 NEWS                     | 3 +++
b74969
 sapi/fpm/fpm/fpm_stdio.c | 4 ++++
b74969
 2 files changed, 7 insertions(+)
b74969
b74969
diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c
b74969
index 10b867d..d81e101 100644
b74969
--- a/sapi/fpm/fpm/fpm_stdio.c
b74969
+++ b/sapi/fpm/fpm/fpm_stdio.c
b74969
@@ -291,7 +291,11 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */
b74969
 		fd = fpm_globals.error_log_fd; /* for FD_CLOSEXEC to work */
b74969
 	} else {
b74969
 		fpm_globals.error_log_fd = fd;
b74969
+#if HAVE_UNISTD_H
b74969
+		if (fpm_global_config.daemonize || !isatty(STDERR_FILENO)) {
b74969
+#else
b74969
 		if (fpm_global_config.daemonize) {
b74969
+#endif
b74969
 			zlog_set_fd(fpm_globals.error_log_fd);
b74969
 		}
b74969
 	}
b74969
-- 
b74969
1.7.11.5
b74969