X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdf.c;h=688c32229a133e6d62c28c49bf4b03c69d04cb22;hp=dd90f243343396ec5742288bceff12d4e34e5de6;hb=7111bb6df7628edce3a8e538b386fbe27633a191;hpb=1b10ab706f8b70ce2f086e59a54cc09d671ad989 diff --git a/src/df.c b/src/df.c index dd90f243..688c3222 100644 --- a/src/df.c +++ b/src/df.c @@ -152,6 +152,7 @@ static int df_read(void) { #elif HAVE_STATFS struct statfs statbuf; #endif + int retval = 0; /* struct STATANYFS statbuf; */ cu_mount_t *mnt_list; @@ -284,8 +285,10 @@ static int df_read(void) { (gauge_t)((float_t)(blk_reserved) / statbuf.f_blocks * 100)); df_submit_one(disk_name, "percent_bytes", "used", (gauge_t)((float_t)(blk_used) / statbuf.f_blocks * 100)); - } else - return -1; + } else { + retval = -1; + break; + } } /* inode handling */ @@ -315,8 +318,10 @@ static int df_read(void) { df_submit_one( disk_name, "percent_inodes", "used", (gauge_t)((float_t)(inode_used) / statbuf.f_files * 100)); - } else - return -1; + } else { + retval = -1; + break; + } } if (values_absolute) { df_submit_one(disk_name, "df_inodes", "free", (gauge_t)inode_free); @@ -329,7 +334,7 @@ static int df_read(void) { cu_mount_freelist(mnt_list); - return 0; + return retval; } /* int df_read */ void module_register(void) {