diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-09-07 12:24:32 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-09-24 18:06:36 +0200 |
commit | 3c65d78d77e43de12284417012fad2d8c195770e (patch) | |
tree | 77854c971c13784e9e734aecc1aaf5213fc8f98c /darwin/Platform.c | |
parent | ebcf92464353d44c1d01b5afd286314415a66c96 (diff) |
Update CPU freq display to use NAN on error
Diffstat (limited to 'darwin/Platform.c')
-rw-r--r-- | darwin/Platform.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c index 1186fe04..129b1cb9 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -19,6 +19,7 @@ in the source distribution for its full text. #include "zfs/ZfsCompressedArcMeter.h" #include "DarwinProcessList.h" +#include <math.h> #include <stdlib.h> @@ -210,7 +211,7 @@ double Platform_setCPUValues(Meter* mtr, int cpu) { /* Convert to percent and return */ total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL]; - mtr->values[CPU_METER_FREQUENCY] = -1; + mtr->values[CPU_METER_FREQUENCY] = NAN; return CLAMP(total, 0.0, 100.0); } |