From 1f0156c5219ccae789355ac68dd19e8cd455db05 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 11 Jun 2015 14:48:02 +0100 Subject: [PATCH] processes plugin: Initialize the cswitch_{in,}vol fields. --- src/processes.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/processes.c b/src/processes.c index 0649eab2..fde96f89 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1740,6 +1740,7 @@ static int ps_read (void) continue; } + memset (&pse, 0, sizeof (pse)); pse.id = pid; pse.age = 0; @@ -2014,6 +2015,7 @@ static int ps_read (void) } } /* if (process has argument list) */ + memset (&pse, 0, sizeof (pse)); pse.id = procs[i].p_pid; pse.age = 0; @@ -2043,6 +2045,9 @@ static int ps_read (void) pse.io_syscr = -1; pse.io_syscw = -1; + pse.cswitch_vol = -1; + pse.cswitch_invol = -1; + ps_list_add (procs[i].p_comm, have_cmdline ? cmdline : NULL, &pse); } /* if ((proc_ptr == NULL) || (proc_ptr->p_pid != procs[i].p_pid)) */ @@ -2258,6 +2263,7 @@ static int ps_read (void) continue; } + memset (&pse, 0, sizeof (pse)); pse.id = pid; pse.age = 0; @@ -2284,6 +2290,9 @@ static int ps_read (void) pse.io_syscr = ps.io_syscr; pse.io_syscw = ps.io_syscw; + pse.cswitch_vol = -1; + pse.cswitch_invol = -1; + switch (state) { case 'R': running++; break; -- 2.11.0