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>
This commit is contained in:
Christoph M. Becker 2020-06-09 10:12:32 +02:00
parent eadd980706
commit 7ac0fb5ae4
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ PHP NEWS
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
. Fixed bug #79668 (get_defined_functions(true) may miss functions). (cmb,
Nikita)
. Fixed possibly unsupported timercmp() usage. (cmb)
- Filter:
. Fixed bug #73527 (Invalid memory access in php_filter_strip). (cmb)

View File

@ -919,7 +919,7 @@ skip_bind:
if (timeout) {
gettimeofday(&time_now, NULL);
if (timercmp(&time_now, &limit_time, >=)) {
if (!timercmp(&time_now, &limit_time, <)) {
/* time limit expired; don't attempt any further connections */
fatal = 1;
} else {