[SIGAR-129] add another sanity check
This commit is contained in:
parent
bf61ce78a9
commit
ede7b6c9de
|
@ -148,6 +148,11 @@ SIGAR_DECLARE(int) sigar_proc_cpu_get(sigar_t *sigar, sigar_pid_t pid,
|
|||
|
||||
memcpy(prev, proccpu, sizeof(*prev));
|
||||
|
||||
if (proccpu->total < otime) {
|
||||
/* XXX this should not happen */
|
||||
otime = 0;
|
||||
}
|
||||
|
||||
if (otime == 0) {
|
||||
proccpu->percent = 0.0;
|
||||
/* first time called */
|
||||
|
|
Loading…
Reference in New Issue