ports/169174: [patch] sysutils/htop: fix swap size calculation on i386
vsjcfm at gmail.com
vsjcfm at gmail.com
Sun Jun 17 08:20:10 UTC 2012
>Number: 169174
>Category: ports
>Synopsis: [patch] sysutils/htop: fix swap size calculation on i386
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jun 17 08:20:09 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Sayetsky Anton <vsjcfm at gmail.com>
>Release: FreeBSD 8.3-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD jw.local 8.3-RELEASE-p1 FreeBSD 8.3-RELEASE-p1 #0 r235504: Wed May 16 14:33:18 EEST 2012 root at jw.local:/tmp/obj/mnt/garbage/build/src/sys/JASONW i386
>Description:
There is an error in my previous htop patch. Swap values can overflow on i386.
>How-To-Repeat:
Install htop 1.0.1_1 and create swap >2GiB, you will see a value of -2097152MiB
>Fix:
Patch for previous patch attached.
--- patch-Makefile begins here ---
--- /usr/ports/sysutils/htop/Makefile 2012-05-30 00:22:56.000000000 +0300
+++ Makefile 2012-06-17 10:53:16.000000000 +0300
@@ -7,7 +7,7 @@
PORTNAME= htop
PORTVERSION= 1.0.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= SF
--- patch-Makefile ends here ---
--- patch-patch-ProcessList.c begins here ---
--- /usr/ports/sysutils/htop/files/patch-ProcessList.c 2012-05-30 00:22:56.000000000 +0300
+++ patch-ProcessList.c 2012-06-17 10:53:54.000000000 +0300
@@ -51,8 +51,8 @@
+ kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL);
+ assert(kd != NULL);
+ kvm_getswapinfo(kd, kvmswapinfo, 1, 0);
-+ this->totalSwap = kvmswapinfo[0].ksw_total * PAGE_SIZE / KB;
-+ this->usedSwap = kvmswapinfo[0].ksw_used * PAGE_SIZE / KB;
++ this->totalSwap = kvmswapinfo[0].ksw_total * (PAGE_SIZE / KB);
++ this->usedSwap = kvmswapinfo[0].ksw_used * (PAGE_SIZE / KB);
+ kvm_close(kd);
+ len = sizeof(this->totalMem);
+ SYSCTLBYNAME("vm.stats.vm.v_page_count", this->totalMem, len);
--- patch-patch-ProcessList.c ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list