diff options
author | Vladimir Kobal <vlad@prokk.net> | 2019-02-21 11:22:58 +0200 |
---|---|---|
committer | Costa Tsaousis <costa@tsaousis.gr> | 2019-02-21 11:22:58 +0200 |
commit | 72b9b47403c67f1ef396b8ebced04daa8c5e8f40 (patch) | |
tree | 4a473057eeeb875df9697a8cb7992b619c6c0768 /collectors/cgroups.plugin | |
parent | 76c4236233d1cd1bdbe8ec2d3eaf066eb779e971 (diff) |
Fix Coverity defects (#5394)
* Fix Checked Return issue
* Fix Unintended Integer Division issue
Diffstat (limited to 'collectors/cgroups.plugin')
-rw-r--r-- | collectors/cgroups.plugin/sys_fs_cgroup.c | 2 |
1 files changed, 1 insertions, 1 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); |