---
components/cpu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/components/cpu.c b/components/cpu.c
index d9bd018..47a10c5 100644
--- a/components/cpu.c
+++ b/components/cpu.c
@@ -92,6 +92,11 @@
return NULL;
}
+ if (a[CP_USER] + a[CP_NICE] + a[CP_SYS] + a[CP_INTR] +
a[CP_IDLE] ==
+ b[CP_USER] + b[CP_NICE] + b[CP_SYS] + b[CP_INTR] +
b[CP_IDLE]) {
+ return NULL;
+ }
+
return bprintf("%d", 100 *
((a[CP_USER] + a[CP_NICE] + a[CP_SYS] +
a[CP_INTR]) -
--
2.20.1- [hackers] [slstatus][PATCH] cpu_perc: Check for division by ... Ingo Feinerer
- [hackers] [slstatus][PATCH] cpu_perc: Check for divisio... Ingo Feinerer
- Re: [hackers] [slstatus][PATCH] cpu_perc: Check for... Michael Buch
- Re: [hackers] [slstatus][PATCH] cpu_perc: Check... Ingo Feinerer
- [hackers] [slstatus][PATCH] cpu_perc: Check for divisio... Ingo Feinerer
- [hackers] [slstatus][PATCH] cpu_perc: Check for divisio... Ingo Feinerer
- Re: [hackers] [slstatus][PATCH] cpu_perc: Check for... Michael Buch
- Re: [hackers] [slstatus][PATCH] cpu_perc: Check... Ingo Feinerer
- Re: [hackers] [slstatus][PATCH] cpu_perc: C... Michael Buch
- Re: [hackers] [slstatus][PATCH] cpu_pe... Michael Buch
- Re: [hackers] [slstatus][PATCH] cpu_perc: Check for... Aaron Marcher
