summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-03-22 15:08:52 +0000
committerAntony Dovgal <tony2001@php.net>2005-03-22 15:08:52 +0000
commit9ba553599380b889b9e1ed965d118d3447b99a64 (patch)
treedd85db0610bfb2796810aa6dadc34f4db51c6371 /sapi/cli/php_cli.c
parent7af2c5e44b8933e9b1bb3da65dec6d6196a0d3cc (diff)
downloadphp-git-9ba553599380b889b9e1ed965d118d3447b99a64.tar.gz
fix #28803 (enabled debug causes bailout errors with CLI on AIX
because of fflush() called on already closed filedescriptor)
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index aab039a8f6..3334313724 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -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