From 53f791cb6b55512101a0a0f42f9d91c356fa9591 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 2 Oct 2009 11:37:05 +0200 Subject: [PATCH] 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 :) --- src/contextswitch.c | 5 +---- src/processes.c | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) 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; -- 2.30.2