diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2010-02-25 01:43:18 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2010-02-25 01:43:18 +0000 |
commit | 02a30bfecdd841b4ca48acfc9b5f2df7930e7a69 (patch) | |
tree | 0a86343ad37f77c10ed6cea35b49e5ff2b926163 /ProcessList.c | |
parent | 5cc89986887de19c8898ce36e3776b3483a72f2d (diff) |
warning fixes
Diffstat (limited to 'ProcessList.c')
-rw-r--r-- | ProcessList.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ProcessList.c b/ProcessList.c index 25ea4ff8..f3845d63 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -27,6 +27,7 @@ in the source distribution for its full text. #include <stdbool.h> #include <sys/utsname.h> #include <stdarg.h> +#include <math.h> #include "debug.h" #include <assert.h> @@ -699,6 +700,7 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P int percent_cpu = (process->utime + process->stime - lasttimes) / period * 100.0; process->percent_cpu = MAX(MIN(percent_cpu, processors*100.0), 0.0); + if (isnan(process->percent_cpu)) process->percent_cpu = 0.0; process->percent_mem = (process->m_resident * PAGE_SIZE_KB) / (float)(this->totalMem) * |