databases/mongodb[78]0: improve a patch

Be pedantic that '!= 0' is not the same as '== -1'. And indeed -1 is what
is documented in the man page of _umtx_op to indicate an error.

No functional change expected.

Reported by:	https://github.com/mongodb/mongo/pull/1607#pullrequestreview-2677292316
This commit is contained in:
Ronald Klop 2025-08-29 13:59:20 +02:00
parent 5e74cc0c0c
commit cd759f83ef
No known key found for this signature in database
GPG Key ID: 551E8E6207A42166
4 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
PORTNAME= mongodb
DISTVERSIONPREFIX= r
DISTVERSION= 7.0.23
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= databases net
PKGNAMESUFFIX= ${DISTVERSION:R:S/.//}

View File

@ -52,7 +52,7 @@
+ }
+
+ int umtxOpRet;
+ if ((umtxOpRet = _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAIT_UINT_PRIVATE, old, (void*)sizeof(struct _umtx_time), uaddr2)) != 0) {
+ if ((umtxOpRet = _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAIT_UINT_PRIVATE, old, (void*)sizeof(struct _umtx_time), uaddr2)) == -1) {
+ if (errno == ETIMEDOUT) {
+ return false;
+ }

View File

@ -1,6 +1,7 @@
PORTNAME= mongodb
DISTVERSIONPREFIX= r
DISTVERSION= 8.0.12
PORTREVISION= 1
CATEGORIES= databases net
PKGNAMESUFFIX= ${DISTVERSION:R:S/.//}

View File

@ -52,7 +52,7 @@
+ }
+
+ int umtxOpRet;
+ if ((umtxOpRet = _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAIT_UINT_PRIVATE, old, (void*)sizeof(struct _umtx_time), uaddr2)) != 0) {
+ if ((umtxOpRet = _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAIT_UINT_PRIVATE, old, (void*)sizeof(struct _umtx_time), uaddr2)) == -1) {
+ if (errno == ETIMEDOUT) {
+ return false;
+ }