From: octo Date: Sun, 29 Jan 2006 22:14:59 +0000 (+0000) Subject: `df.c' now includes `sys/statv?fs.h'.. X-Git-Tag: collectd-3.7.0~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a0eb2471697b4690ae5f5805c50027a0e72ebb7c;p=collectd.git `df.c' now includes `sys/statv?fs.h'.. --- diff --git a/ChangeLog b/ChangeLog index 0a86b388..f592a63a 100644 --- 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 diff --git a/src/df.c b/src/df.c index 8cc9f2eb..6b7df311 100644 --- a/src/df.c +++ b/src/df.c @@ -34,9 +34,15 @@ #endif #if HAVE_STATVFS +# if HAVE_SYS_STATVFS_H +# include +# 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 +# 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;