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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user