mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Fix #79650: php-win.exe 100% cpu lockup
As of PHP 7.3.0, `sapi_cli_single_write()` is supposed to return `< 0` on failure, but `fwrite()` returns a `size_t`, and signals error by setting the stream's error indicator. We have to cater to that.
This commit is contained in:
parent
744f9016c4
commit
923c45bdca
2
NEWS
2
NEWS
@ -2,6 +2,8 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.3.20
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
|
||||
|
||||
?? ??? ????, PHP 7.3.19
|
||||
|
||||
|
@ -279,6 +279,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user