[SIGAR-74] Properly initialize proc_cpu.percent

This commit is contained in:
Doug MacEachern 2007-11-11 15:57:07 +00:00
parent 118b86824d
commit 9775fe6400
1 changed files with 1 additions and 0 deletions

View File

@ -144,6 +144,7 @@ SIGAR_DECLARE(int) sigar_proc_cpu_get(sigar_t *sigar, sigar_pid_t pid,
memcpy(prev, proccpu, sizeof(*prev));
if (otime == 0) {
proccpu->percent = 0.0;
/* first time called */
return SIGAR_OK;
}