summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-06-09 10:12:32 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-06-09 16:52:19 +0200
commit7ac0fb5ae48b2513c8949780c2b067be7bfdceb0 (patch)
treed2a528c5944fc35d1992f0925019b83c09bcd8dd
parenteadd98070662f0c56d7138bcb2a42d397c11f6e4 (diff)
downloadphp-git-7ac0fb5ae48b2513c8949780c2b067be7bfdceb0.tar.gz
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>
-rw-r--r--NEWS1
-rw-r--r--main/network.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 746b8a4a4d..f16ac1d9b7 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/main/network.c b/main/network.c
index f00c775c6f..3c8e81cc81 100644
--- a/main/network.c
+++ b/main/network.c
@@ -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 {