diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-01-20 12:45:47 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-01-20 12:45:47 +0000 |
commit | 5a05b3642ff261a09dc5d969e06c7fcad52eb193 (patch) | |
tree | 98c6ccc9c83c268224e6fd7cc641db8796887d5f /plugin_proc_stat.c | |
parent | 024cf9ff9a01665704542dc7dab017710e22c8b5 (diff) | |
download | lcd4linux-5a05b3642ff261a09dc5d969e06c7fcad52eb193.tar.gz |
[lcd4linux @ 2004-01-20 12:45:47 by reinelt]
"Default screen" working with MatrixOrbital
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@323 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'plugin_proc_stat.c')
-rw-r--r-- | plugin_proc_stat.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugin_proc_stat.c b/plugin_proc_stat.c index 3857995..52c0ad6 100644 --- a/plugin_proc_stat.c +++ b/plugin_proc_stat.c @@ -1,4 +1,4 @@ -/* $Id: plugin_proc_stat.c,v 1.5 2004/01/18 09:01:45 reinelt Exp $ +/* $Id: plugin_proc_stat.c,v 1.6 2004/01/20 12:45:47 reinelt Exp $ * * plugin for /proc/stat parsing * @@ -23,6 +23,9 @@ * * * $Log: plugin_proc_stat.c,v $ + * Revision 1.6 2004/01/20 12:45:47 reinelt + * "Default screen" working with MatrixOrbital + * * Revision 1.5 2004/01/18 09:01:45 reinelt * /proc/stat parsing finished * @@ -248,8 +251,11 @@ static void my_cpu (RESULT *result, RESULT *arg1, RESULT *arg2) else if (strcasecmp(key, "idle" )==0) value=cpu_idle; else if (strcasecmp(key, "busy" )==0) value=cpu_total-cpu_idle; - value = 100*value/cpu_total; - + if (cpu_total>0.0) + value = 100*value/cpu_total; + else + value=0.0; + SetResult(&result, R_NUMBER, &value); } |