From: octo Date: Tue, 14 Mar 2006 08:52:10 +0000 (+0000) Subject: Merged 516:518 from `trunk' to `tags/collectd-3.8.2' X-Git-Tag: collectd-3.8.2~1 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=40e9303e0532660cf854a153dff204eaaab33214 Merged 516:518 from `trunk' to `tags/collectd-3.8.2' --- diff --git a/ChangeLog b/ChangeLog index 76273a49..7291b5ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-14, Version 3.8.2 + * `utils_mount.c' has been changed to not use the `MNTTAB' defined by + the GNU libc, because it points to `/etc/fstab' rather than + `/etc/mtab'. + 2006-03-13, Version 3.8.1 * Fixes for building collectd unter FreeBSD, Mac OS X and Solaris. * Fixes in the debian `postinst' and `init.d' scripts. diff --git a/collectd.spec b/collectd.spec index 41d2cbeb..a74acf12 100644 --- a/collectd.spec +++ b/collectd.spec @@ -88,6 +88,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0444,root,root) %{_libdir}/%{name}/sensors.so* %changelog +* Thu Mar 14 2006 Florian octo Forster 3.8.2-1 +- New upstream version + * Thu Mar 13 2006 Florian octo Forster 3.8.1-1 - New upstream version diff --git a/configure.in b/configure.in index 1c8617d3..b7ea8439 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(collectd, 3.8.1) +AC_INIT(collectd, 3.8.2) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE(dist-bzip2) diff --git a/debian/changelog b/debian/changelog index 0a7872dc..de8dbb36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +collectd (3.8.2-1) unstable; urgency=low + + * New upstream version + + -- Florian Forster Tue, 14 Mar 2006 09:47:00 +0200 + collectd (3.8.1-1) unstable; urgency=low * New upstream version diff --git a/src/utils_mount.c b/src/utils_mount.c index 72ce9301..176040aa 100644 --- a/src/utils_mount.c +++ b/src/utils_mount.c @@ -29,6 +29,7 @@ #define XFS_SUPER_MAGIC_STR "XFSB" #define XFS_SUPER_MAGIC2_STR "BSFX" #endif + #include "utils_debug.h" #include "utils_mount.h" @@ -51,18 +52,26 @@ # include #endif -#ifndef MNTTAB -# if defined(_PATH_MOUNTED) -# define MNTTAB _PATH_MOUNTED -# elif defined(MNT_MNTTAB) -# define MNTTAB MNT_MNTTAB -# elif defined(MNTTABNAME) -# define MNTTAB MNTTABNAME -# elif defined(KMTAB) -# define MNTTAB KMTAB -# else -# define MNTTAB "/etc/mnttab" -# endif +#if HAVE_PATHS_H +# include +#endif + +#ifdef COLLECTD_MNTTAB +# undef COLLECTD_MNTTAB +#endif + +#if defined(_PATH_MOUNTED) /* glibc */ +# define COLLECTD_MNTTAB _PATH_MOUNTED +#elif defined(MNTTAB) /* Solaris */ +# define COLLECTD_MNTTAB MNTTAB +#elif defined(MNT_MNTTAB) +# define COLLECTD_MNTTAB MNT_MNTTAB +#elif defined(MNTTABNAME) +# define COLLECTD_MNTTAB MNTTABNAME +#elif defined(KMTAB) +# define COLLECTD_MNTTAB KMTAB +#else +# define COLLECTD_MNTTAB "/etc/mnttab" #endif /* *** *** *** ********************************************* *** *** *** */ @@ -362,7 +371,7 @@ static cu_mount_t *cu_mount_listmntent (void) struct mntent *mnt; struct tabmntent *mntlist; - if(listmntent(&mntlist, MNTTAB, NULL, NULL) < 0) { + if(listmntent(&mntlist, COLLECTD_MNTTAB, NULL, NULL) < 0) { DBG("calling listmntent() failed: %s", strerror(errno)); } @@ -477,8 +486,13 @@ static cu_mount_t *cu_mount_gen_getmntent (void) cu_mount_t *last = NULL; cu_mount_t *new = NULL; - if ((fp = fopen (MNTTAB, "r")) == NULL) + DBG ("(void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB); + + if ((fp = fopen (COLLECTD_MNTTAB, "r")) == NULL) + { + syslog (LOG_ERR, "fopen (%s): %s", COLLECTD_MNTTAB, strerror (errno)); return (NULL); + } while (getmntent (fp, &mt) == 0) { @@ -531,8 +545,13 @@ static cu_mount_t *cu_mount_getmntent (void) cu_mount_t *last = NULL; cu_mount_t *new = NULL; - if ((fp = setmntent (MNTTAB, "r")) == NULL) + DBG ("(void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB); + + if ((fp = setmntent (COLLECTD_MNTTAB, "r")) == NULL) + { + syslog (LOG_ERR, "setmntent (%s): %s", COLLECTD_MNTTAB, strerror (errno)); return (NULL); + } while ((me = getmntent (fp)) != NULL) { @@ -548,6 +567,9 @@ static cu_mount_t *cu_mount_getmntent (void) new->device = get_device_name (new->options); new->next = NULL; + DBG ("new = {dir = %s, spec_device = %s, type = %s, options = %s, device = %s}", + new->dir, new->spec_device, new->type, new->options, new->device); + /* Append to list */ if (first == NULL) { @@ -563,6 +585,8 @@ static cu_mount_t *cu_mount_getmntent (void) endmntent (fp); + DBG ("return (0x%p)", (void *) first); + return (first); } #endif /* HAVE_GETMNTENT */ @@ -622,6 +646,8 @@ void cu_mount_freelist (cu_mount_t *list) cu_mount_t *this; cu_mount_t *next; + DBG ("(list = 0x%p)", (void *) list); + for (this = list; this != NULL; this = next) { next = this->next;