diff options
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r-- | sapi/cli/php_cli.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index a5fafda4f1..d068952343 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -260,6 +260,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; } |