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