From 477673f123b5e562299e471f46a4632939ef91f5 Mon Sep 17 00:00:00 2001 From: Martin Wilke Date: Sat, 29 Mar 2008 23:56:27 +0000 Subject: - Fix memory bug when you have more than 3 GB PR: 121316 Submitted by: MQ Approved by: maintainer timeout --- sysutils/xfce4-systemload-plugin/Makefile | 3 +-- .../files/patch-panel-plugin-memswap.c | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 sysutils/xfce4-systemload-plugin/files/patch-panel-plugin-memswap.c (limited to 'sysutils/xfce4-systemload-plugin') diff --git a/sysutils/xfce4-systemload-plugin/Makefile b/sysutils/xfce4-systemload-plugin/Makefile index bcf125020391..637b7d68ef22 100644 --- a/sysutils/xfce4-systemload-plugin/Makefile +++ b/sysutils/xfce4-systemload-plugin/Makefile @@ -7,7 +7,7 @@ PORTNAME= xfce4-systemload-plugin PORTVERSION= 0.4.2 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils xfce MASTER_SITES= http://goodies.xfce.org/releases/${PORTNAME}/ DIST_SUBDIR= xfce4 @@ -21,6 +21,5 @@ USE_GETTEXT= yes USE_GMAKE= yes USE_GNOME= gnometarget gtk20 intltool intlhack pkgconfig USE_XFCE= configenv panel -USE_XLIB= yes .include diff --git a/sysutils/xfce4-systemload-plugin/files/patch-panel-plugin-memswap.c b/sysutils/xfce4-systemload-plugin/files/patch-panel-plugin-memswap.c new file mode 100644 index 000000000000..d682fb5ee019 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/files/patch-panel-plugin-memswap.c @@ -0,0 +1,24 @@ +--- panel-plugin/memswap.c.orig 2007-01-18 02:01:09.000000000 +0800 ++++ panel-plugin/memswap.c 2008-03-03 21:01:50.000000000 +0800 +@@ -203,7 +203,7 @@ + gint read_memswap(gulong *mem, gulong *swap, gulong *MT, gulong *MU, gulong *ST, gulong *SU) + { + int total_pages; +- int free_pages; ++ u_int free_pages; + int inactive_pages; + int pagesize = getpagesize(); + int swap_avail; +@@ -222,8 +222,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) { + + -- cgit v1.2.3