diff options
author | reinelt <> | 2004-01-14 11:33:00 +0000 |
---|---|---|
committer | reinelt <> | 2004-01-14 11:33:00 +0000 |
commit | b8448093e2f554744fa5911b2c96174b78f4ae0f (patch) | |
tree | 8322150effdcffca715e116498851a2bba00c953 /plugin_cpuinfo.c | |
parent | b626a0b1272e703d01a8001ddd7bab7b3cd5b6e3 (diff) | |
download | lcd4linux-b8448093e2f554744fa5911b2c96174b78f4ae0f.tar.gz |
[lcd4linux @ 2004-01-14 11:33:00 by reinelt]
new plugin 'uname' which does what it's called
text widget nearly finished
first results displayed on MatrixOrbital
Diffstat (limited to 'plugin_cpuinfo.c')
-rw-r--r-- | plugin_cpuinfo.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugin_cpuinfo.c b/plugin_cpuinfo.c index 031429f..60b0880 100644 --- a/plugin_cpuinfo.c +++ b/plugin_cpuinfo.c @@ -1,4 +1,4 @@ -/* $Id: plugin_cpuinfo.c,v 1.1 2004/01/13 10:03:01 reinelt Exp $ +/* $Id: plugin_cpuinfo.c,v 1.2 2004/01/14 11:33:00 reinelt Exp $ * * plugin for /proc/cpuinfo parsing * @@ -23,6 +23,11 @@ * * * $Log: plugin_cpuinfo.c,v $ + * Revision 1.2 2004/01/14 11:33:00 reinelt + * new plugin 'uname' which does what it's called + * text widget nearly finished + * first results displayed on MatrixOrbital + * * Revision 1.1 2004/01/13 10:03:01 reinelt * new util 'hash' for associative arrays * new plugin 'cpuinfo' @@ -67,7 +72,8 @@ static void my_cpuinfo (RESULT *result, RESULT *arg1) stream=fopen("/proc/cpuinfo", "r"); if (stream==NULL) { error ("fopen(/proc/cpuinfo) failed: %s", strerror(errno)); - goto error; + SetResult(&result, R_STRING, ""); + return; } while (!feof(stream)) { @@ -91,9 +97,7 @@ static void my_cpuinfo (RESULT *result, RESULT *arg1) hash_set (&CPUinfo, key, val); } - fclose (stream); - time(&now); } @@ -101,8 +105,6 @@ static void my_cpuinfo (RESULT *result, RESULT *arg1) val=hash_get(&CPUinfo, key); if (val==NULL) val=""; - error: - // val=""; SetResult(&result, R_STRING, val); } |