@cryptotaxi247 / netdata-1 / commits / a33ceed41

fixes suggested by coverity

Costa Tsaousis (ktsaou) committed Jan 15, 2017 at 06:48 UTC a33ceed418e85b9a996c132da9143a8c048e4bb7
2 files changed +7 -8
src/plugin_proc_diskspace.c
+6 -7
@@ -186,7 +186,6 @@ void *proc_diskspace_main(void *ptr) {
186 check_for_new_mountpoints_every = update_every;
187
188 RRDSET *stcpu_thread = NULL, *st_duration = NULL;
189 - RRDDIM *rd_user = NULL, *rd_system = NULL, *rd_duration = NULL;
189 struct rusage thread;
190
191 usec_t last = 0, dt = 0;
@@ -242,15 +241,15 @@ void *proc_diskspace_main(void *ptr) {
241 , "NetData Disk Space Plugin CPU usage", "milliseconds/s", 132020
242 , update_every, RRDSET_TYPE_STACKED);
243
245 - rd_user = rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL);
246 - rd_system = rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
244 + rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL);
245 + rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
246 }
247 }
248 else
249 rrdset_next(stcpu_thread);
250
252 - rrddim_set_by_pointer(stcpu_thread, rd_user, thread.ru_utime.tv_sec * 1000000ULL + thread.ru_utime.tv_usec);
253 - rrddim_set_by_pointer(stcpu_thread, rd_system, thread.ru_stime.tv_sec * 1000000ULL + thread.ru_stime.tv_usec);
251 + rrddim_set(stcpu_thread, "user", thread.ru_utime.tv_sec * 1000000ULL + thread.ru_utime.tv_usec);
252 + rrddim_set(stcpu_thread, "system", thread.ru_stime.tv_sec * 1000000ULL + thread.ru_stime.tv_usec);
253 rrdset_done(stcpu_thread);
254
255 // ----------------------------------------------------------------
@@ -262,13 +261,13 @@ void *proc_diskspace_main(void *ptr) {
261 , "NetData Disk Space Plugin Duration", "milliseconds/run", 132021
262 , update_every, RRDSET_TYPE_AREA);
263
265 - rd_duration = rrddim_add(st_duration, "duration", NULL, 1, 1000, RRDDIM_ABSOLUTE);
264 + rrddim_add(st_duration, "duration", NULL, 1, 1000, RRDDIM_ABSOLUTE);
265 }
266 }
267 else
268 rrdset_next(st_duration);
269
271 - rrddim_set_by_pointer(st_duration, rd_duration, dt);
270 + rrddim_set(st_duration, "duration", dt);
271 rrdset_done(st_duration);
272
273 // ----------------------------------------------------------------
src/sys_fs_cgroup.c
+1 -1
@@ -1546,7 +1546,7 @@ void *cgroups_main(void *ptr) {
1546 struct rusage thread;
1547
1548 // when ZERO, attempt to do it
1549 - int vdo_cpu_netdata = config_get_boolean("plugin:cgroups", "cgroups plugin resources", 1);
1549 + int vdo_cpu_netdata = config_get_boolean("plugin:cgroups", "cgroups plugin resource charts", 1);
1550
1551 read_cgroup_plugin_configuration();
1552