From a0eb2471697b4690ae5f5805c50027a0e72ebb7c Mon Sep 17 00:00:00 2001 From: octo Date: Sun, 29 Jan 2006 22:14:59 +0000 Subject: [PATCH] `df.c' now includes `sys/statv?fs.h'.. --- ChangeLog | 1 + src/df.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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; -- 2.11.0