[SIGAR-74] Properly initialize proc_cpu.percent
This commit is contained in:
parent
118b86824d
commit
9775fe6400
@ -144,6 +144,7 @@ SIGAR_DECLARE(int) sigar_proc_cpu_get(sigar_t *sigar, sigar_pid_t pid,
|
|||||||
memcpy(prev, proccpu, sizeof(*prev));
|
memcpy(prev, proccpu, sizeof(*prev));
|
||||||
|
|
||||||
if (otime == 0) {
|
if (otime == 0) {
|
||||||
|
proccpu->percent = 0.0;
|
||||||
/* first time called */
|
/* first time called */
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user