diff options
author | maya <maya@pkgsrc.org> | 2017-11-24 02:06:13 +0000 |
---|---|---|
committer | maya <maya@pkgsrc.org> | 2017-11-24 02:06:13 +0000 |
commit | c3c361fd657c0b86c6883a9934797029aea1c4c7 (patch) | |
tree | 87c5769849a4044b74389e29aa8d9ff384e1cd17 /sysutils | |
parent | feb5a42479edba1e499f5c1c0181e513bd2aa472 (diff) | |
download | pkgsrc-c3c361fd657c0b86c6883a9934797029aea1c4c7.tar.gz |
htop: workaround differences in how linux and netbsd count memory usage
a bogus value is displayed for used memory as usedMem ends up as a negative
quantity. use (total memory - free memory) instead.
PR pkg/52669: htop displays wrong used memory
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/htop/Makefile | 3 | ||||
-rw-r--r-- | sysutils/htop/distinfo | 3 | ||||
-rw-r--r-- | sysutils/htop/patches/patch-linux_Platform.c | 18 |
3 files changed, 22 insertions, 2 deletions
diff --git a/sysutils/htop/Makefile b/sysutils/htop/Makefile index cba7bea6a2a..42d6d85f54c 100644 --- a/sysutils/htop/Makefile +++ b/sysutils/htop/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.15 2017/01/31 22:24:28 maya Exp $ +# $NetBSD: Makefile,v 1.16 2017/11/24 02:06:13 maya Exp $ DISTNAME= htop-2.0.2 CATEGORIES= sysutils MASTER_SITES= http://hisham.hm/htop/releases/${PKGVERSION_NOREV}/ +PKGREVISION= 1 MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://hisham.hm/htop/ diff --git a/sysutils/htop/distinfo b/sysutils/htop/distinfo index 51712d1c561..6619e9e6782 100644 --- a/sysutils/htop/distinfo +++ b/sysutils/htop/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.10 2017/03/25 10:53:59 maya Exp $ +$NetBSD: distinfo,v 1.11 2017/11/24 02:06:13 maya Exp $ SHA1 (htop-2.0.2.tar.gz) = 201f793f13dce2448e36047079875b9bd5bba75a RMD160 (htop-2.0.2.tar.gz) = af17b9f7e1744e2db4d6a28c95cdfb9536343786 @@ -6,3 +6,4 @@ SHA512 (htop-2.0.2.tar.gz) = 1c9bf71a36c56b301667aa6d03756fc757fbcb63e848d9581d1 Size (htop-2.0.2.tar.gz) = 476364 bytes SHA1 (patch-TraceScreen.c) = 85f9e26c9a2ddf1e1b4df7010194a43bf622b2ea SHA1 (patch-configure.ac) = 87557f0b0027462f244cd0c9e14739d10bbfc010 +SHA1 (patch-linux_Platform.c) = d37f4f5116023fa8d8f58f6b925e4f86e9748cea diff --git a/sysutils/htop/patches/patch-linux_Platform.c b/sysutils/htop/patches/patch-linux_Platform.c new file mode 100644 index 00000000000..10db80e234f --- /dev/null +++ b/sysutils/htop/patches/patch-linux_Platform.c @@ -0,0 +1,18 @@ +$NetBSD: patch-linux_Platform.c,v 1.1 2017/11/24 02:06:13 maya Exp $ + +Workaround differences in counting memory netbsd vs. linux. +PR 52669 - a bogus value is displayed for used memory because this +quantity becomes negative. + +--- linux/Platform.c.orig 2016-02-02 14:58:45.000000000 +0000 ++++ linux/Platform.c +@@ -200,7 +200,9 @@ void Platform_setMemoryValues(Meter* thi + long int usedMem = pl->usedMem; + long int buffersMem = pl->buffersMem; + long int cachedMem = pl->cachedMem; ++#ifndef __NetBSD__ + usedMem -= buffersMem + cachedMem; ++#endif + this->total = pl->totalMem; + this->values[0] = usedMem; + this->values[1] = buffersMem; |