summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-06-01 13:23:59 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-06-01 13:24:32 +0200
commitb26ad33001cf9612fde9c7506bf6856f63b8845c (patch)
treeb9aa45d1e3e06bb5f6d4ba2ab47a521559b9831f /sapi/cli/php_cli.c
parent8068fad481d1c80a03e360161da7a43227c50356 (diff)
parent923c45bdcaebf317ce84a4bfb3fa39beae1bf952 (diff)
downloadphp-git-b26ad33001cf9612fde9c7506bf6856f63b8845c.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79650: php-win.exe 100% cpu lockup
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 1b14b7586b..91f400aca4 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -266,6 +266,9 @@ PHP_CLI_API ssize_t sapi_cli_single_write(const char *str, size_t str_length) /*
} while (ret <= 0 && errno == EAGAIN && sapi_cli_select(STDOUT_FILENO));
#else
ret = fwrite(str, 1, MIN(str_length, 16384), stdout);
+ if (ret == 0 && ferror(stdout)) {
+ return -1;
+ }
#endif
return ret;
}