summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d6c7b0)
raw | patch | inline | side by side (parent: 1d6c7b0)
author | Chao Yang <cyang244@bloomberg.net> | |
Mon, 26 Sep 2016 15:13:57 +0000 (11:13 -0400) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 28 Sep 2016 13:19:28 +0000 (15:19 +0200) |
src/cpu.c | patch | blob | history |
diff --git a/src/cpu.c b/src/cpu.c
index 105c8ecc42a631a8fadc6d3ef77df3af033d20af..cd5e7da63f32b0e4ee460035aa1aa66093bb29ee 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
value_to_rate_state_t* conv, cdtime_t now)
{
gauge_t rate = NAN;
- value_t val = { .derive = d };
- int status = value_to_rate (&rate, val, DS_TYPE_DERIVE, now, conv);
+ int status = value_to_rate (&rate, (value_t) { .derive = d }, DS_TYPE_DERIVE, now, conv);
if (status != 0)
return (status);
#if defined(HAVE_PERFSTAT) /* {{{ */
cdtime_t now = cdtime ();
- perfstat_cpu_total_t cputotal;
- memset(&cputotal, 0, sizeof(perfstat_cpu_total_t));
+ perfstat_cpu_total_t cputotal = { 0 };
- if (!perfstat_cpu_total(NULL, &cputotal, sizeof(perfstat_cpu_total_t), 1)) {
+ if (!perfstat_cpu_total(NULL, &cputotal, sizeof(cputotal), 1)) {
char errbuf[1024];
WARNING ("cpu plugin: perfstat_cpu_total: %s",
sstrerror (errno, errbuf, sizeof (errbuf)));