diff options
author | linimon <linimon@FreeBSD.org> | 2003-12-08 10:41:01 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2003-12-08 10:41:01 +0800 |
commit | b94acdf76b42476192fa511d32af5adadf665577 (patch) | |
tree | 2043f3f4d1d9c20326f91ccc026582121f2200a2 | |
parent | e9002dfb87d68ee1c53138a5b28efc04d293152d (diff) | |
download | freebsd-ports-gnome-b94acdf76b42476192fa511d32af5adadf665577.tar.gz freebsd-ports-gnome-b94acdf76b42476192fa511d32af5adadf665577.tar.zst freebsd-ports-gnome-b94acdf76b42476192fa511d32af5adadf665577.zip |
Update to 0.3.3. patch-memswap.c has been incorporated into the
upstream distribution; other changes are new translations and bugfixes.
Tested on both 4.x and 5.x.
PR: ports/58788
Submitted by: Thorsten Greiner <thorsten.greiner@web.de> (maintainer)
4 files changed, 12 insertions, 120 deletions
diff --git a/sysutils/xfce4-systemload-plugin/Makefile b/sysutils/xfce4-systemload-plugin/Makefile index 352ef36c75c8..271c43fd8c25 100644 --- a/sysutils/xfce4-systemload-plugin/Makefile +++ b/sysutils/xfce4-systemload-plugin/Makefile @@ -6,7 +6,7 @@ # PORTNAME= xfce4-systemload-plugin -PORTVERSION= 0.3.2 +PORTVERSION= 0.3.3 CATEGORIES= sysutils xfce MASTER_SITES= http://download.berlios.de/xfce-goodies/ DIST_SUBDIR= xfce4 diff --git a/sysutils/xfce4-systemload-plugin/distinfo b/sysutils/xfce4-systemload-plugin/distinfo index 515da2df2cf5..8c5b2ca31fb0 100644 --- a/sysutils/xfce4-systemload-plugin/distinfo +++ b/sysutils/xfce4-systemload-plugin/distinfo @@ -1 +1 @@ -MD5 (xfce4/xfce4-systemload-plugin-0.3.2.tar.gz) = 54f940ea77261bb61ca54dd77253c222 +MD5 (xfce4/xfce4-systemload-plugin-0.3.3.tar.gz) = 10868e9e910e0c8ac355436d2a44e641 diff --git a/sysutils/xfce4-systemload-plugin/files/patch-memswap.c b/sysutils/xfce4-systemload-plugin/files/patch-memswap.c deleted file mode 100644 index 1d58d38bd145..000000000000 --- a/sysutils/xfce4-systemload-plugin/files/patch-memswap.c +++ /dev/null @@ -1,118 +0,0 @@ ---- panel-plugin/memswap.c.orig Tue Jul 29 21:40:55 2003 -+++ panel-plugin/memswap.c Thu Jul 31 22:43:10 2003 -@@ -193,4 +193,113 @@ - - return 0; - } --#endif -\ No newline at end of file -+#endif -+ -+#if defined(__FreeBSD__) -+/* -+ * This is inspired by /usr/src/usr.bin/top/machine.c -+ * -+ * Adapted by Thorsten Greiner <thorsten.greiner@web.de> -+ * -+ * Original authors: Christos Zoulas <christos@ee.cornell.edu> -+ * Steven Wallace <swallace@freebsd.org> -+ * Wolfram Schneider <wosch@FreeBSD.org> -+ * Thomas Moestl <tmoestl@gmx.net> -+ */ -+ -+#include <sys/types.h> -+#include <fcntl.h> -+#include <kvm.h> -+ -+#define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) -+ -+static int getsysctl (char *name, void *ptr, size_t len) -+{ -+ size_t nlen = len; -+ if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { -+ return -1; -+ } -+ if (nlen != len) { -+ return -1; -+ } -+ return 0; -+} -+ -+static kvm_t *kd = NULL; -+ -+static int swapmode(int *retavail, int *retfree) -+{ -+ int n; -+ int pagesize = getpagesize(); -+ struct kvm_swap swapary[1]; -+ static int kd_init = TRUE; -+ -+ if(kd_init) { -+ kd_init = FALSE; -+ if ((kd = kvm_open("/dev/null", "/dev/null", "/dev/null", -+ O_RDONLY, "kvm_open")) == NULL) { -+ g_warning("Cannot read kvm."); -+ return -1; -+ } -+ } -+ if(kd == NULL) { -+ return -1; -+ } -+ -+ *retavail = 0; -+ *retfree = 0; -+ -+#define CONVERT(v) ((quad_t)(v) * pagesize / 1024) -+ -+ n = kvm_getswapinfo(kd, swapary, 1, 0); -+ if (n < 0 || swapary[0].ksw_total == 0) -+ return(0); -+ -+ *retavail = CONVERT(swapary[0].ksw_total); -+ *retfree = CONVERT(swapary[0].ksw_total - swapary[0].ksw_used); -+ -+ n = (int)((double)swapary[0].ksw_used * 100.0 / -+ (double)swapary[0].ksw_total); -+ return(n); -+} -+ -+gint read_memswap(gulong *mem, gulong *swap, gulong *MT, gulong *MU, gulong *ST, gulong *SU) -+{ -+ int total_pages; -+ int free_pages; -+ int inactive_pages; -+ int pagesize = getpagesize(); -+ int swap_avail; -+ int swap_free; -+ -+ if(GETSYSCTL("vm.stats.vm.v_page_count", total_pages)) { -+ g_warning("Cannot read sysctl \"vm.stats.vm.v_page_count\""); -+ return -1; -+ } -+ if(GETSYSCTL("vm.stats.vm.v_free_count", free_pages)) { -+ g_warning("Cannot read sysctl \"vm.stats.vm.v_free_count\""); -+ return -1; -+ } -+ if(GETSYSCTL("vm.stats.vm.v_inactive_count", inactive_pages)) { -+ g_warning("Cannot read sysctl \"vm.stats.vm.v_inactive_count\""); -+ return -1; -+ } -+ -+ *MT = (total_pages*pagesize) >> 10; -+ *MU = ((total_pages-free_pages-inactive_pages) * pagesize) >> 10; -+ *mem = *MU * 100 / *MT; -+ -+ if((*swap = swapmode(&swap_avail, &swap_free)) >= 0) { -+ *ST = swap_avail; -+ *SU = (swap_avail - swap_free); -+ } -+ else { -+ *swap = 0; -+ *ST = 0; -+ *SU = 0; -+ } -+ -+ return 0; -+} -+ -+#endif /* defined(__FREEBSD) */ diff --git a/sysutils/xfce4-systemload-plugin/files/patch-panel-plugin:uptime.c b/sysutils/xfce4-systemload-plugin/files/patch-panel-plugin:uptime.c new file mode 100644 index 000000000000..539fdf6db3e9 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/files/patch-panel-plugin:uptime.c @@ -0,0 +1,10 @@ +--- panel-plugin/uptime.c.orig Fri Nov 21 16:21:22 2003 ++++ panel-plugin/uptime.c Fri Nov 21 16:21:36 2003 +@@ -81,6 +81,7 @@ + #include <string.h> + #include <sys/param.h> + #include <sys/sysctl.h> ++#include <sys/time.h> + #include <sys/types.h> + #include <sys/vmmeter.h> + #include <unistd.h> |