Skip to content

Commit 7ac0fb5

Browse files
committed
Fix possibly unsupported timercmp() usage
The `timercmp()` manpage[1] points out that some systems have a broken implementation which does not support `>=`. This is definitely the case for the Windows SDK, which only supports `<` and `>`. [1] <https://linux.die.net/man/3/timercmp>
1 parent eadd980 commit 7ac0fb5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PHP NEWS
66
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
77
. Fixed bug #79668 (get_defined_functions(true) may miss functions). (cmb,
88
Nikita)
9+
. Fixed possibly unsupported timercmp() usage. (cmb)
910

1011
- Filter:
1112
. Fixed bug #73527 (Invalid memory access in php_filter_strip). (cmb)

main/network.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
919919
if (timeout) {
920920
gettimeofday(&time_now, NULL);
921921

922-
if (timercmp(&time_now, &limit_time, >=)) {
922+
if (!timercmp(&time_now, &limit_time, <)) {
923923
/* time limit expired; don't attempt any further connections */
924924
fatal = 1;
925925
} else {

0 commit comments

Comments
 (0)