1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Handle broken hrtime in ftp

Part of GH-19210.

Closes GH-19219.
This commit is contained in:
Niels Dossche
2025-07-23 11:32:16 +02:00
parent ad2143f3b0
commit beeeee2978

View File

@@ -1471,7 +1471,8 @@ static int my_poll(php_socket_t fd, int events, int timeout) {
if (n == -1 && php_socket_errno() == EINTR) {
zend_hrtime_t delta_ns = zend_hrtime() - start_ns;
if (delta_ns > timeout_hr) {
/* delta_ns == 0 is only possible with a platform that does not support a high-res timer. */
if (delta_ns > timeout_hr || UNEXPECTED(delta_ns == 0)) {
#ifndef PHP_WIN32
errno = ETIMEDOUT;
#endif