From: Florian Forster Date: Fri, 2 Oct 2009 09:37:05 +0000 (+0200) Subject: contextswitches, processes plugins: Don't print an error if number of fields don... X-Git-Tag: collectd-4.9.0~56 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=53f791cb6b55512101a0a0f42f9d91c356fa9591;p=collectd.git contextswitches, processes plugins: Don't print an error if number of fields don't match. Because we pick the required line further down, having lines with more fields is not illegal anymore. Thanks to Patrik Weiskircher for noticing :) --- diff --git a/src/contextswitch.c b/src/contextswitch.c index b53b5740..7787203d 100644 --- a/src/contextswitch.c +++ b/src/contextswitch.c @@ -64,11 +64,8 @@ static int cs_read (void) char *endptr; numfields = strsplit(buffer, fields, STATIC_ARRAY_SIZE (fields)); - if (numfields != 2) { - ERROR ("contextswitch plugin: ctxt in /proc/stat " - "contains more than 2 fields."); + if (numfields != 2) continue; - } if (strcmp("ctxt", fields[0]) != 0) continue; diff --git a/src/processes.c b/src/processes.c index 8b937968..5f67abaa 100644 --- a/src/processes.c +++ b/src/processes.c @@ -861,11 +861,9 @@ static unsigned long read_fork_rate () char *endptr; numfields = strsplit(buf, fields, STATIC_ARRAY_SIZE (fields)); - if (numfields != 2) { - ERROR ("processes plugin: processes in /proc/stat " - "contains more than 2 fields."); + if (numfields != 2) continue; - } + if (strcmp ("processes", fields[0]) != 0) continue;