summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi-Wen Hsu <lwhsu@FreeBSD.org>2020-05-23 10:05:31 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2020-05-23 10:05:31 +0000
commit0aacfec7efe8fead9d5e821f5d64a35abc75350c (patch)
tree72fe50c57ded9a8d51cc320cf1ac29161e308250
parentMFH: r536265 (diff)
MFH: r536278
- Apply fix for memory detection from upstream PR: 246667 Submitted by: James Wright <james.wright@digital-chaos.com> (maintainer) Differential Revision: https://reviews.freebsd.org/D24967 Approved by: ports-secteam (joneum)
-rw-r--r--sysutils/apache-mesos/Makefile2
-rw-r--r--sysutils/apache-mesos/files/patch-3rdparty_stout_include_stout_os_freebsd.hpp49
2 files changed, 50 insertions, 1 deletions
diff --git a/sysutils/apache-mesos/Makefile b/sysutils/apache-mesos/Makefile
index b5cfe3b0c9d6..8a61e7e9e809 100644
--- a/sysutils/apache-mesos/Makefile
+++ b/sysutils/apache-mesos/Makefile
@@ -2,7 +2,7 @@
PORTNAME= mesos
PORTVERSION= 1.9.0
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= sysutils
MASTER_SITES= APACHE/mesos/${PORTVERSION}
PKGNAMEPREFIX= apache-
diff --git a/sysutils/apache-mesos/files/patch-3rdparty_stout_include_stout_os_freebsd.hpp b/sysutils/apache-mesos/files/patch-3rdparty_stout_include_stout_os_freebsd.hpp
new file mode 100644
index 000000000000..381337499dd9
--- /dev/null
+++ b/sysutils/apache-mesos/files/patch-3rdparty_stout_include_stout_os_freebsd.hpp
@@ -0,0 +1,49 @@
+--- 3rdparty/stout/include/stout/os/freebsd.hpp.orig 2020-05-22 20:48:06 UTC
++++ 3rdparty/stout/include/stout/os/freebsd.hpp
+@@ -88,18 +88,29 @@ inline Try<Memory> memory()
+ const size_t pageSize = os::pagesize();
+
+ unsigned int freeCount;
+- size_t length = sizeof(freeCount);
+-
++ size_t freeCountLength = sizeof(freeCount);
+ if (sysctlbyname(
+- "vm.stats.v_free_count",
++ "vm.stats.vm.v_free_count",
+ &freeCount,
+- &length,
++ &freeCountLength,
+ nullptr,
+ 0) != 0) {
+ return ErrnoError();
+ }
+- memory.free = Bytes(freeCount * pageSize);
+
++ unsigned int inactiveCount;
++ size_t inactiveCountLength = sizeof(inactiveCount);
++ if (sysctlbyname(
++ "vm.stats.vm.v_inactive_count",
++ &inactiveCount,
++ &inactiveCountLength,
++ nullptr,
++ 0) != 0) {
++ return ErrnoError();
++ }
++
++ memory.free = Bytes((freeCount + inactiveCount) * pageSize);
++
+ int totalBlocks = 0;
+ int usedBlocks = 0;
+
+@@ -112,8 +123,9 @@ inline Try<Memory> memory()
+ // FreeBSD supports multiple swap devices. Here we sum across all of them.
+ struct xswdev xswd;
+ size_t xswdSize = sizeof(xswd);
+- int* mibDevice = &(mib[mibSize + 1]);
+- for (*mibDevice = 0; ; (*mibDevice)++) {
++ for (int ndev = 0; ; ndev++) {
++ mib[mibSize] = ndev;
++
+ if (::sysctl(mib, 3, &xswd, &xswdSize, nullptr, 0) != 0) {
+ if (errno == ENOENT) {
+ break;