com php-src: Fix Bug #69865 php-fpm does not close stderr when using syslog: NEWS sapi/fpm/fpm/fpm_stdio.c
| From: | Joe Watkins | Date: | Mon, 23 Jan 2017 16:55:15 +0000 |
| Subject: | com php-src: Fix Bug #69865 php-fpm does not close stderr when using syslog: NEWS sapi/fpm/fpm/fpm_stdio.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96851@lists.php.net to get a copy of this message | ||
Commit: 80a851b4dd622f5825e46a7318bdd80123205b02
Author: Michael Wallner <mike@php.net> Wed, 22 Jul 2015 13:44:21 +0200
Committer: Joe Watkins <krakjoe@php.net> Mon, 23 Jan 2017 16:55:15 +0000
Parents: d636467937fcfbd708f2b06c9e060bcbe9a63679
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=80a851b4dd622f5825e46a7318bdd80123205b02
Log:
Fix Bug #69865 php-fpm does not close stderr when using syslog
Bugs:
https://bugs.php.net/69865
Changed paths:
M NEWS
M sapi/fpm/fpm/fpm_stdio.c
Diff:
diff --git a/NEWS b/NEWS
index ac14eeb..e76d755 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ PHP NEWS
- FPM:
. Fixed bug #67583 (double fastcgi_end_request on max_children limit).
(Dmitry Saprykin)
+ . Fixed bug #69865 (php-fpm does not close stderr when using syslog).
+ (m6w6)
- GD:
. Fixed bug #73968 (Premature failing of XBM reading). (cmb)
diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c
index e28c0cb..4072017 100644
--- a/sapi/fpm/fpm/fpm_stdio.c
+++ b/sapi/fpm/fpm/fpm_stdio.c
@@ -73,6 +73,12 @@ int fpm_stdio_init_final() /* {{{ */
return -1;
}
}
+#ifdef HAVE_SYSLOG_H
+ else if (fpm_globals.error_log_fd == ZLOG_SYSLOG) {
+ /* dup to /dev/null when using syslog */
+ dup2(STDOUT_FILENO, STDERR_FILENO);
+ }
+#endif
}
zlog_set_launched();
return 0;