FreeBSD Bugzilla – Attachment 81083 Details for
Bug 116144
sysutils/ganglia-monitor-core crashes frequently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.33 KB, created by
KOIE Hidetaka
on 2007-09-06 08:40:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
KOIE Hidetaka
Created:
2007-09-06 08:40:02 UTC
Size:
3.33 KB
patch
obsolete
>*** ../ganglia-3.0.4/libmetrics/freebsd/metrics.c.orig Thu Sep 6 01:21:28 2007 >--- ../ganglia-3.0.4/libmetrics/freebsd/metrics.c Thu Sep 6 13:21:01 2007 >*************** static int mibswap[MIB_SWAPINFO_SIZE]; >*** 99,105 **** >--- 99,109 ---- > static size_t mibswap_size; > static kvm_t *kd = NULL; > static int pagesize; >+ #if 1 /*patch*/ >+ static int skipvfs = 1; >+ #else /*!patch*/ > static int skipvfs; >+ #endif /*!patch*/ > > /* Function prototypes */ > static long percentages(int cnt, int *out, register long *new, >*************** find_disk_space(double *total, double *t >*** 865,871 **** >--- 869,878 ---- > > netvfslist = makenetvfslist(); > vfslist = makevfslist(netvfslist); >+ #if 1 /*patch*/ >+ #else /*!patch*/ /* vfslist[] points in netvfslist. */ > free(netvfslist); >+ #endif /*!patch*/ > > mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); > mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); >*************** find_disk_space(double *total, double *t >*** 883,888 **** >--- 890,899 ---- > *tot_avail += mntbuf[i].f_bavail / toru; > } > } >+ #if 1/*patch*/ >+ free(vfslist); >+ free(netvfslist); >+ #endif /*patch*/ > > return most_full; > } >*************** makevfslist(fslist) >*** 939,945 **** >--- 950,960 ---- > return (NULL); > if (fslist[0] == 'n' && fslist[1] == 'o') { > fslist += 2; >+ #if 1 /*patch*/ >+ skipvfs = 0; >+ #else /*!patch*/ > skipvfs = 1; >+ #endif /*!patch*/ > } > for (i = 0, nextcp = fslist; *nextcp; nextcp++) > if (*nextcp == ',') >*************** makenetvfslist(void) >*** 991,996 **** >--- 1006,1027 ---- > goto done; > } > >+ #if 1 /*patch*/ >+ cnt = 0; >+ for (i = 0; i < maxvfsconf; i++, xvfsp++) { >+ if (xvfsp->vfc_typenum == 0) >+ continue; >+ if (xvfsp->vfc_flags & VFCF_NONLOCAL) >+ continue; >+ >+ listptr[cnt] = strdup(xvfsp->vfc_name); >+ if (listptr[cnt] == NULL) { >+ warnx("malloc failed"); >+ goto done; >+ } >+ cnt++; >+ } >+ #else /*!patch*/ > for (cnt = 0; cnt < maxvfsconf; xvfsp++) { > if (xvfsp->vfc_flags & VFCF_NONLOCAL) > continue; >*************** makenetvfslist(void) >*** 1002,1007 **** >--- 1033,1039 ---- > } > cnt++; > } >+ #endif /*!patch*/ > #else > int mib[3], maxvfsconf; > size_t miblen; >*************** makenetvfslist(void) >*** 1041,1050 **** >--- 1073,1092 ---- > * Count up the string lengths, we need a extra byte to hold > * the between entries ',' or the NUL at the end. > */ >+ #if 1 /*patch*/ >+ slen = 0; >+ for (i = 0; i < cnt; i++) >+ slen += strlen(listptr[i]); >+ /* for ',' */ >+ slen += cnt - 1; >+ /* Add 3 for initial "no" and the NUL. */ >+ slen += 3; >+ #else /*!patch*/ > for (i = 0; i < cnt; i++) > slen = strlen(listptr[i]) + 1; > /* Add 2 for initial "no". */ > slen += 2; >+ #endif /*!patch*/ > > if ((str = malloc(slen)) == NULL) { > warnx("malloc failed"); >*************** makenetvfslist(void) >*** 1053,1064 **** >--- 1095,1116 ---- > > str[0] = 'n'; > str[1] = 'o'; >+ #if 1 /*patch*/ >+ for (i = 0, strptr = str + 2; i < cnt; i++) { >+ if (i > 0) >+ *strptr++ = ','; >+ strcpy(strptr, listptr[i]); >+ strptr += strlen(listptr[i]); >+ } >+ *strptr = '\0'; >+ #else /*!patch*/ /* extra comma at the tail of strptr. */ > for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { > strcpy(strptr, listptr[i]); > strptr += strlen(listptr[i]); > *strptr = ','; > } > *strptr = '\0'; >+ #endif /*!patch*/ > > done: > #if __FreeBSD_version > 500000
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 116144
: 81083