diff options
-rw-r--r-- | collectors/cgroups.plugin/sys_fs_cgroup.c | 2 | ||||
-rw-r--r-- | collectors/proc.plugin/sys_fs_btrfs.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/collectors/cgroups.plugin/sys_fs_cgroup.c b/collectors/cgroups.plugin/sys_fs_cgroup.c index f42bc71446..a57dc3a1ec 100644 --- a/collectors/cgroups.plugin/sys_fs_cgroup.c +++ b/collectors/cgroups.plugin/sys_fs_cgroup.c @@ -2476,7 +2476,7 @@ void update_cgroup_charts(int update_every) { else rrdset_next(cg->st_cpu_limit); - calculated_number cpu_usage = (cg->cpuacct_stat.user + cg->cpuacct_stat.system) * 100 / system_hz; + calculated_number cpu_usage = (calculated_number)(cg->cpuacct_stat.user + cg->cpuacct_stat.system) * 100 / system_hz; calculated_number cpu_used = 100 * (cpu_usage - cg->prev_cpu_usage) / (value * update_every); rrdset_isnot_obsolete(cg->st_cpu_limit); diff --git a/collectors/proc.plugin/sys_fs_btrfs.c b/collectors/proc.plugin/sys_fs_btrfs.c index 5aab24c1a8..cb25ad440d 100644 --- a/collectors/proc.plugin/sys_fs_btrfs.c +++ b/collectors/proc.plugin/sys_fs_btrfs.c @@ -308,7 +308,11 @@ static inline int find_all_btrfs_pools(const char *path) { char label[FILENAME_MAX + 1] = ""; snprintfz(filename, FILENAME_MAX, "%s/%s/label", path, de->d_name); - read_file(filename, label, FILENAME_MAX); + if(read_file(filename, label, FILENAME_MAX) != 0) { + error("BTRFS: failed to read '%s'", filename); + btrfs_free_node(node); + continue; + } char *s = label; if (s[0]) |