tony2001 Tue Mar 22 10:08:54 2005 EDT
Modified files:
/php-src/sapi/cli php_cli.c
Log:
fix #28803 (enabled debug causes bailout errors with CLI on AIX
because of fflush() called on already closed filedescriptor)
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.121&r2=1.122&ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.121 php-src/sapi/cli/php_cli.c:1.122
--- php-src/sapi/cli/php_cli.c:1.121 Fri Mar 18 17:11:53 2005
+++ php-src/sapi/cli/php_cli.c Tue Mar 22 10:08:52 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli.c,v 1.121 2005/03/18 22:11:53 sniper Exp $ */
+/* $Id: php_cli.c,v 1.122 2005/03/22 15:08:52 tony2001 Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -220,7 +220,10 @@
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
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php