aboutsummaryrefslogtreecommitdiff
path: root/sysutils/ganglia-monitor-core
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2009-01-30 23:01:39 +0000
committerBrooks Davis <brooks@FreeBSD.org>2009-01-30 23:01:39 +0000
commitc9c565ee5103385741ae673b2690610277b948d0 (patch)
treec491d1b31495a7ac021e8cc8debc26cebc4e2c4b /sysutils/ganglia-monitor-core
parentecd7eeb4b6618ea23063f0ec64a4883ff3e30274 (diff)
downloadports-c9c565ee5103385741ae673b2690610277b948d0.tar.gz
ports-c9c565ee5103385741ae673b2690610277b948d0.zip
Notes
Diffstat (limited to 'sysutils/ganglia-monitor-core')
-rw-r--r--sysutils/ganglia-monitor-core/Makefile5
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c83
2 files changed, 86 insertions, 2 deletions
diff --git a/sysutils/ganglia-monitor-core/Makefile b/sysutils/ganglia-monitor-core/Makefile
index fb68f474c1ce..324a439531b0 100644
--- a/sysutils/ganglia-monitor-core/Makefile
+++ b/sysutils/ganglia-monitor-core/Makefile
@@ -7,6 +7,7 @@
PORTNAME= monitor-core
PORTVERSION= 3.1.1
+PORTREVISION= 1
CATEGORIES= sysutils net parallel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ganglia
@@ -38,7 +39,7 @@ SUB_FILES= pkg-install
.if defined (GMETAD_CONF)
.if !exists (${GMETAD_CONF})
-IGNORE= GMETAD_CONF must point to an existing file when defined
+IGNORE= the variable GMETAD_CONF must point to a file when defined
.endif
.else
GMETAD_CONF= ${WRKSRC}/gmetad/gmetad.conf
@@ -46,7 +47,7 @@ GMETAD_CONF= ${WRKSRC}/gmetad/gmetad.conf
.if defined (GMOND_CONF)
.if !exists (${GMOND_CONF})
-IGNORE= GMOND_CONF must point to an existing file when defined
+IGNORE= the variable GMOND_CONF must point to a file when defined
.endif
.else
GMOND_CONF= ${WRKDIR}/gmond.conf
diff --git a/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c b/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c
new file mode 100644
index 000000000000..d92d1c35a8cd
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c
@@ -0,0 +1,83 @@
+
+$FreeBSD$
+
+--- libmetrics/freebsd/metrics.c.orig
++++ libmetrics/freebsd/metrics.c
+@@ -106,7 +106,7 @@
+ static size_t mibswap_size;
+ static kvm_t *kd = NULL;
+ static int pagesize;
+-static int skipvfs;
++static int skipvfs = 1;
+
+ /* Function prototypes */
+ static long percentages(int cnt, int *out, register long *new,
+@@ -881,7 +881,6 @@
+
+ netvfslist = makenetvfslist();
+ vfslist = makevfslist(netvfslist);
+- free(netvfslist);
+
+ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
+ mntsize = regetmntinfo(&mntbuf, mntsize, vfslist);
+@@ -899,6 +898,8 @@
+ *tot_avail += mntbuf[i].f_bavail / toru;
+ }
+ }
++ free(vfslist);
++ free(netvfslist);
+
+ return most_full;
+ }
+@@ -955,7 +956,7 @@
+ return (NULL);
+ if (fslist[0] == 'n' && fslist[1] == 'o') {
+ fslist += 2;
+- skipvfs = 1;
++ skipvfs = 0;
+ }
+ for (i = 0, nextcp = fslist; *nextcp; nextcp++)
+ if (*nextcp == ',')
+@@ -1007,7 +1008,10 @@
+ goto done;
+ }
+
+- for (cnt = 0; cnt < maxvfsconf; xvfsp++) {
++ cnt = 0;
++ for (i = 0; i < maxvfsconf; i++, xvfsp++) {
++ if (xvfsp->vfc_typenum == 0)
++ continue;
+ if (xvfsp->vfc_flags & VFCF_NONLOCAL)
+ continue;
+
+@@ -1057,10 +1061,13 @@
+ * Count up the string lengths, we need a extra byte to hold
+ * the between entries ',' or the NUL at the end.
+ */
++ slen = 0;
+ for (i = 0; i < cnt; i++)
+- slen = strlen(listptr[i]) + 1;
+- /* Add 2 for initial "no". */
+- slen += 2;
++ slen += strlen(listptr[i]);
++ /* for ',' */
++ slen += cnt - 1;
++ /* Add 3 for initial "no" and the NUL. */
++ slen += 3;
+
+ if ((str = malloc(slen)) == NULL) {
+ warnx("malloc failed");
+@@ -1069,10 +1076,11 @@
+
+ str[0] = 'n';
+ str[1] = 'o';
+- for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) {
++ for (i = 0, strptr = str + 2; i < cnt; i++) {
++ if (i > 0)
++ *strptr++ = ',';
+ strcpy(strptr, listptr[i]);
+ strptr += strlen(listptr[i]);
+- *strptr = ',';
+ }
+ *strptr = '\0';
+