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 b53b574..7787203 100644 (file)
@@ -64,11 +64,8 @@ static int cs_read (void)
                char *endptr;
 
                numfields = strsplit(buffer, fields, STATIC_ARRAY_SIZE (fields));
                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;
                        continue;
-               }
 
                if (strcmp("ctxt", fields[0]) != 0)
                        continue;
 
                if (strcmp("ctxt", fields[0]) != 0)
                        continue;
index 8b93796..5f67aba 100644 (file)
@@ -861,11 +861,9 @@ static unsigned long read_fork_rate ()
                char *endptr;
 
                numfields = strsplit(buf, fields, STATIC_ARRAY_SIZE (fields));
                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;
                        continue;
-               }
+
                if (strcmp ("processes", fields[0]) != 0)
                        continue;
 
                if (strcmp ("processes", fields[0]) != 0)
                        continue;