]> granicus.if.org Git - php/commitdiff
MFH: fix #28803 (enabled debug causes bailout errors with CLI on AIX
authorAntony Dovgal <tony2001@php.net>
Tue, 22 Mar 2005 15:09:20 +0000 (15:09 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 22 Mar 2005 15:09:20 +0000 (15:09 +0000)
because of fflush() called on already closed filedescriptor)

NEWS
sapi/cli/php_cli.c

diff --git a/NEWS b/NEWS
index adeded37e16a2023400cbd6a21bc20b7c97c5bfc..4a9104d22ff6dd5dd9eeebae72a1a083f57e9047 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -150,6 +150,8 @@ PHP                                                                        NEWS
 - Fixed bug #30106 (SOAP cannot not parse 'ref' element. Causes Uncaught
   SoapFault exception). (Dmitry)
 - Fixed bug #29989 (type re_registers redefined in oniguruma.h). (Moriyoshi)
+- Fixed bug #28803 (enabled debug causes bailout errors with CLI on AIX 
+  because of fflush() called on already closed filedescriptor). (Tony)
 - Fixed bug #29767 (Weird behaviour of __set($name, $value)). (Dmitry)
 - Fixed bug #29733 (printf() handles repeated placeholders wrong).
   (bugs dot php dot net at bluetwanger dot de, Ilia)
index 5e04ea6eca29e330d76bd200ba268ded584d9b39..8b527ba504b568ceafb5229dbb779f1fefe47156 100644 (file)
@@ -220,7 +220,10 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC)
 
 static void sapi_cli_flush(void *server_context)
 {
-       if (fflush(stdout)==EOF) {
+       /* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams
+        * are/could be closed before fflush() is called.
+        */
+       if (fflush(stdout)==EOF && errno!=EBADF) {
 #ifndef PHP_CLI_WIN32_NO_CONSOLE
                php_handle_aborted_connection();
 #endif