"temp" was unused
the loop updates the load statistics correctly.
nibs
--- /mod_backhand/platform.c Sun Feb 10 01:58:23 2002
***************
*** 451,457 ****
register float ourcpu = 0.0;
vm_statistics_data_t vminfo;
host_load_info_data_t loadinfo;
- register host_cpu_load_info_t temp;
count = HOST_VM_INFO_COUNT;
kr = host_statistics(mach_host_self(), HOST_VM_INFO,
(host_info_t)&vminfo, &count);
--- 451,456 ----
***************
*** 475,480 ****
--- 474,481 ----
ourcpu = 1.0 - (((float)(newcpuinfo.cpu_ticks[CPU_STATE_IDLE] -
oldcpuinfo.cpu_ticks[CPU_STATE_IDLE])) /
ourcpu);
ourcpu *= 1000.0;
+ for(i = 0; i < CPU_STATE_MAX; i++)
+ oldcpuinfo.cpu_ticks[i] = newcpuinfo.cpu_ticks[i];
ss->load = (double)loadinfo.avenrun[0];
ss->load_hwm = set_high_watermark() * 1000;
the loop updates the load statistics correctly.
nibs
--- /mod_backhand/platform.c Sun Feb 10 01:58:23 2002
***************
*** 451,457 ****
register float ourcpu = 0.0;
vm_statistics_data_t vminfo;
host_load_info_data_t loadinfo;
- register host_cpu_load_info_t temp;
count = HOST_VM_INFO_COUNT;
kr = host_statistics(mach_host_self(), HOST_VM_INFO,
(host_info_t)&vminfo, &count);
--- 451,456 ----
***************
*** 475,480 ****
--- 474,481 ----
ourcpu = 1.0 - (((float)(newcpuinfo.cpu_ticks[CPU_STATE_IDLE] -
oldcpuinfo.cpu_ticks[CPU_STATE_IDLE])) /
ourcpu);
ourcpu *= 1000.0;
+ for(i = 0; i < CPU_STATE_MAX; i++)
+ oldcpuinfo.cpu_ticks[i] = newcpuinfo.cpu_ticks[i];
ss->load = (double)loadinfo.avenrun[0];
ss->load_hwm = set_high_watermark() * 1000;