aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-01-22 08:55:30 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-01-22 08:55:30 +0000
commitc817553542fbdd8687c56509d206dede574ffe69 (patch)
treed9384e256c311f9e826f5be71b0035f4dae3817f
parent4c88d373fbdae381318e6e5da9c88e5de98d7f7a (diff)
downloadlcd4linux-c817553542fbdd8687c56509d206dede574ffe69.tar.gz
[lcd4linux @ 2004-01-22 08:55:30 by reinelt]
fixed unhandled kernel-2.6 entries in /prco/stat git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@335 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--plugin_proc_stat.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/plugin_proc_stat.c b/plugin_proc_stat.c
index 6b5e8d7..26cc8a9 100644
--- a/plugin_proc_stat.c
+++ b/plugin_proc_stat.c
@@ -1,4 +1,4 @@
-/* $Id: plugin_proc_stat.c,v 1.9 2004/01/21 14:29:03 reinelt Exp $
+/* $Id: plugin_proc_stat.c,v 1.10 2004/01/22 08:55:30 reinelt Exp $
*
* plugin for /proc/stat parsing
*
@@ -23,6 +23,9 @@
*
*
* $Log: plugin_proc_stat.c,v $
+ * Revision 1.10 2004/01/22 08:55:30 reinelt
+ * fixed unhandled kernel-2.6 entries in /prco/stat
+ *
* Revision 1.9 2004/01/21 14:29:03 reinelt
* new helper 'hash_get_regex' which delivers the sum over regex matched items
* new function 'disk()' which uses this regex matching
@@ -164,21 +167,10 @@ static int parse_proc_stat (void)
dev=strtok(NULL, " \t\n:()");
}
}
- else if (strncmp(buffer, "ctxt ", 5)==0) {
- strtok(buffer, " \t\n");
- hash_set2 ("ctxt", NULL, strtok(NULL, " \t\n"));
- }
- else if (strncmp(buffer, "btime ", 6)==0) {
- strtok(buffer, " \t\n");
- hash_set2 ("btime", NULL, strtok(NULL, " \t\n"));
- }
- else if (strncmp(buffer, "processes ", 10)==0) {
- strtok(buffer, " \t\n");
- hash_set1 ("processes", strtok(NULL, " \t\n"));
- }
else {
- error ("internal error: unhandled entry '%s' from /proc/stat", strtok(buffer, " \t\n"));
- }
+ char *key=strtok(buffer, " \t\n");
+ hash_set2 (key, NULL, strtok(NULL, " \t\n"));
+ }
}
fclose (stream);
return 0;