Fix reported memory size on systems with more than 3.5GB real memory.

PR:		ports/155382
Submitted by:	Zhihao Yuan <lichray at gmail.com>
Approved by:	maintainer timeout (several months)
This commit is contained in:
Max Brazhnikov 2011-07-03 12:04:37 +00:00
parent 09d2256f04
commit b9e00780b5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=276976
3 changed files with 25 additions and 1 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= xfce4-systemload-plugin
PORTVERSION= 1.0.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils xfce
MASTER_SITES= ${MASTER_SITE_XFCE}
MASTER_SITE_SUBDIR= src/panel-plugins/${PORTNAME}/${PORTVERSION:R}

View file

@ -0,0 +1,13 @@
--- ./panel-plugin/memswap.c.orig 2010-12-09 19:04:10.000000000 +0300
+++ ./panel-plugin/memswap.c 2011-07-03 15:39:52.384882846 +0400
@@ -228,8 +228,8 @@
return -1;
}
- *MT = (total_pages*pagesize) >> 10;
- *MU = ((total_pages-free_pages-inactive_pages) * pagesize) >> 10;
+ *MT = CONVERT(total_pages);
+ *MU = CONVERT(total_pages-free_pages-inactive_pages);
*mem = *MU * 100 / *MT;
if((*swap = swapmode(&swap_avail, &swap_free)) >= 0) {

View file

@ -0,0 +1,11 @@
--- ./panel-plugin/uptime.c.orig 2010-12-09 19:04:10.000000000 +0300
+++ ./panel-plugin/uptime.c 2011-07-03 15:39:52.391879944 +0400
@@ -93,7 +93,7 @@
int mib[2] = {CTL_KERN, KERN_BOOTTIME};
struct timeval boottime;
time_t now;
- int size = sizeof(boottime);
+ size_t size = sizeof(boottime);
gulong uptime;
if((sysctl(mib, 2, &boottime, &size, NULL, 0) != -1)