X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdf.c;h=4a86799c2e5d7ec7a3bbb6b3003bca8879eede0b;hb=5e4f2ae61dc39938c4df857854724ba1d36f3232;hp=f3bc7e4267eb5151eb02cab049e16be3842eff29;hpb=573db6cb7d8904468546746117efbd989d4a5843;p=collectd.git diff --git a/src/df.c b/src/df.c index f3bc7e42..4a86799c 100644 --- a/src/df.c +++ b/src/df.c @@ -17,14 +17,14 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: - * Florian octo Forster + * Florian octo Forster * Paul Sadauskas **/ #include "collectd.h" + #include "common.h" #include "plugin.h" -#include "configfile.h" #include "utils_mount.h" #include "utils_ignorelist.h" @@ -190,7 +190,6 @@ static int df_read (void) #endif /* struct STATANYFS statbuf; */ cu_mount_t *mnt_list; - cu_mount_t *mnt_ptr; mnt_list = NULL; if (cu_mount_getlist (&mnt_list) == NULL) @@ -199,7 +198,7 @@ static int df_read (void) return (-1); } - for (mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next) + for (cu_mount_t *mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next) { unsigned long long blocksize; char disk_name[256]; @@ -273,12 +272,12 @@ static int df_read (void) sstrncpy (disk_name, "root", sizeof (disk_name)); else { - int i, len; + int len; sstrncpy (disk_name, mnt_ptr->dir + 1, sizeof (disk_name)); len = strlen (disk_name); - for (i = 0; i < len; i++) + for (int i = 0; i < len; i++) if (disk_name[i] == '/') disk_name[i] = '-'; }