Code

`df.c' now includes `sys/statv?fs.h'..
authorocto <octo>
Sun, 29 Jan 2006 22:14:59 +0000 (22:14 +0000)
committerocto <octo>
Sun, 29 Jan 2006 22:14:59 +0000 (22:14 +0000)
ChangeLog
src/df.c

index 0a86b388382247cf829713d79e9f7829bc729fa4..f592a63aa42e5e9cea981dbc1ce7bdbec3d67120 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
          to read the old file, but not to read the new one.
        * The `hddtemp' plugin can now be configured to connect to another
          address and/or port than localhost.
+       * The `df' plugin now prefers `statvfs' over `statfs'.
 
 2006-01-24, Version 3.6.2
        * Due to a bug in the configfile handling collectd wouldn't start in
index 8cc9f2eb440615610ed13ca82eb2500e02a08469..6b7df3112a92b27ecbcaa401eb4663a39ba8f539 100644 (file)
--- a/src/df.c
+++ b/src/df.c
 #endif
 
 #if HAVE_STATVFS
+# if HAVE_SYS_STATVFS_H
+#  include <sys/statvfs.h>
+# endif
 # define STATANYFS statvfs
 # define BLOCKSIZE(s) ((s).f_frsize ? (s).f_frsize : (s).f_bsize)
 #elif HAVE_STATFS
+# if HAVE_SYS_STATFS_H
+#  include <sys/statfs.h>
+# endif
 # define STATANYFS statfs
 # define BLOCKSIZE(s) (s).f_bsize
 #endif
@@ -88,7 +94,12 @@ static void df_submit (char *df_name,
 
 static void df_read (void)
 {
-       struct STATANYFS statbuf;
+#if HAVE_STATVFS
+       struct statvfs statbuf;
+#elif HAVE_STATFS
+       struct statfs statbuf;
+#endif
+       /* struct STATANYFS statbuf; */
        cu_mount_t *mnt_list;
        cu_mount_t *mnt_ptr;