aboutsummaryrefslogtreecommitdiff
path: root/sysutils/xfce4-systemload-plugin
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2003-12-08 02:41:01 +0000
committerMark Linimon <linimon@FreeBSD.org>2003-12-08 02:41:01 +0000
commit43f1d6477113bb38cffadb03101ef7a3a9c14d51 (patch)
tree8e1ca04dc899905e371646434ca42d8f4850260d /sysutils/xfce4-systemload-plugin
parentc29377595853802138b1496fc9f863cbc5de7293 (diff)
downloadports-43f1d6477113bb38cffadb03101ef7a3a9c14d51.tar.gz
ports-43f1d6477113bb38cffadb03101ef7a3a9c14d51.zip
Notes
Diffstat (limited to 'sysutils/xfce4-systemload-plugin')
-rw-r--r--sysutils/xfce4-systemload-plugin/Makefile2
-rw-r--r--sysutils/xfce4-systemload-plugin/distinfo2
-rw-r--r--sysutils/xfce4-systemload-plugin/files/patch-memswap.c118
-rw-r--r--sysutils/xfce4-systemload-plugin/files/patch-panel-plugin:uptime.c10
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>