]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
cpu plugi: Consistently set the `finalized` field at the end of the function.
authorFlorian Forster <octo@collectd.org>
Fri, 19 Jan 2024 20:13:17 +0000 (21:13 +0100)
committerFlorian Forster <octo@collectd.org>
Mon, 22 Jan 2024 15:07:57 +0000 (16:07 +0100)
src/cpu.c

index 74cd986371820ab233af0ab170c0849e502ec178..b07d87c754e38a11585b324d59d0b3f7ae5865c0 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -364,7 +364,6 @@ static int usage_init(usage_t *u, cdtime_t now) {
   }
   u->time = now;
   u->cpu_num = 0;
-  u->finalized = false;
   for (size_t i = 0; i < u->states_num; i++) {
     u->states[i].rate = 0;
     u->states[i].has_rate = false;
@@ -374,6 +373,7 @@ static int usage_init(usage_t *u, cdtime_t now) {
     u->global[s].has_rate = false;
   }
 
+  u->finalized = false;
   return 0;
 }