projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4a75ec
)
avoid useless assignment if not needed
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 17 Sep 2014 20:09:37 +0000
(22:09 +0200)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 17 Sep 2014 20:09:37 +0000
(22:09 +0200)
src/lib/cpu.c
patch
|
blob
|
history
diff --git
a/src/lib/cpu.c
b/src/lib/cpu.c
index
ac70e39
..
9fb389b
100644
(file)
--- a/
src/lib/cpu.c
+++ b/
src/lib/cpu.c
@@
-64,7
+64,7
@@
static double get_usage()
glibtop_cpu cpu;
unsigned long int used;
unsigned long int dt;
- double cpu_rate
= UNKNOWN_DBL_VALUE
;
+ double cpu_rate;
glibtop_get_cpu(&cpu);
@@
-74,6
+74,8
@@
static double get_usage()
if (dt)
cpu_rate = 100 * (used - last_used) / dt;
+ else
+ cpu_rate = UNKNOWN_DBL_VALUE;
last_used = used;
last_total = cpu.total;