Code

contextswitches, processes plugins: Don't print an error if number of fields don...
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 2 Oct 2009 09:37:05 +0000 (11:37 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 2 Oct 2009 09:37:05 +0000 (11:37 +0200)
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
src/processes.c

index b53b5740bd6358ff21a739b59a71a283da0c4980..7787203dde178ad2b5859fd603bf7085b90ba663 100644 (file)
@@ -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;
index 8b937968e2d834f5cbacfab049e9c35b428ef83e..5f67abaa12dd879072ccc4e794e575fc241146a9 100644 (file)
@@ -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;