cpu mhz fixup

This commit is contained in:
Doug MacEachern 2005-02-17 01:42:22 +00:00
parent 218ec3edea
commit dfc17b0616
1 changed files with 5 additions and 5 deletions

View File

@ -1018,14 +1018,14 @@ int sigar_file_system_usage_get(sigar_t *sigar,
int sigar_cpu_info_list_get(sigar_t *sigar,
sigar_cpu_info_list_t *cpu_infos)
{
int i, mhz;
unsigned long long value;
int i;
unsigned int mhz;
size_t size;
char model[128], vendor[128], *ptr;
size = sizeof(value);
if (!sysctlbyname(CTL_HW_FREQ, &value, &size, NULL, 0)) {
mhz = (int)(value / 1000000);
size = sizeof(mhz);
if (!sysctlbyname(CTL_HW_FREQ, &mhz, &size, NULL, 0)) {
mhz /= 1000000;
}
else {
mhz = SIGAR_FIELD_NOTIMPL;