aboutsummaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2022-06-03 08:55:21 +0200
committerDaniel Lange <DLange@git.local>2022-06-03 08:55:21 +0200
commitf8c86394f62c6e6f950fcbbff008f639db33241c (patch)
treee82dcf1ba008020628c96661587ed870e0cac179 /linux/Platform.c
parent4d3dbd693ecd079d5907d81d5d2ff191baa61033 (diff)
parent937052b231259a47d881d539ad5748245ef55b99 (diff)
downloaddebian_htop-f8c86394f62c6e6f950fcbbff008f639db33241c.tar.gz
debian_htop-f8c86394f62c6e6f950fcbbff008f639db33241c.tar.bz2
debian_htop-f8c86394f62c6e6f950fcbbff008f639db33241c.zip
Update upstream source from tag 'upstream/3.2.1'
Update to upstream version '3.2.1' with Debian dir 43b873ddb7f7032e95da61a9cb65eee15c671e73
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index 775f9ae..38b66e8 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -358,8 +358,13 @@ void Platform_setMemoryValues(Meter* this) {
this->values[4] = pl->availableMem;
if (lpl->zfs.enabled != 0 && !Running_containerized) {
- this->values[0] -= lpl->zfs.size;
- this->values[3] += lpl->zfs.size;
+ // ZFS does not shrink below the value of zfs_arc_min.
+ unsigned long long int shrinkableSize = 0;
+ if (lpl->zfs.size > lpl->zfs.min)
+ shrinkableSize = lpl->zfs.size - lpl->zfs.min;
+ this->values[0] -= shrinkableSize;
+ this->values[3] += shrinkableSize;
+ this->values[4] += shrinkableSize;
}
}
@@ -1035,7 +1040,7 @@ bool Platform_init(void) {
char lineBuffer[256];
while (fgets(lineBuffer, sizeof(lineBuffer), fd)) {
// detect lxc or overlayfs and guess that this means we are running containerized
- if (String_startsWith(lineBuffer, "lxcfs ") || String_startsWith(lineBuffer, "overlay ")) {
+ if (String_startsWith(lineBuffer, "lxcfs /proc") || String_startsWith(lineBuffer, "overlay ")) {
Running_containerized = true;
break;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy