cpu mhz fixup
This commit is contained in:
parent
218ec3edea
commit
dfc17b0616
|
@ -1018,14 +1018,14 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
int sigar_cpu_info_list_get(sigar_t *sigar,
|
int sigar_cpu_info_list_get(sigar_t *sigar,
|
||||||
sigar_cpu_info_list_t *cpu_infos)
|
sigar_cpu_info_list_t *cpu_infos)
|
||||||
{
|
{
|
||||||
int i, mhz;
|
int i;
|
||||||
unsigned long long value;
|
unsigned int mhz;
|
||||||
size_t size;
|
size_t size;
|
||||||
char model[128], vendor[128], *ptr;
|
char model[128], vendor[128], *ptr;
|
||||||
|
|
||||||
size = sizeof(value);
|
size = sizeof(mhz);
|
||||||
if (!sysctlbyname(CTL_HW_FREQ, &value, &size, NULL, 0)) {
|
if (!sysctlbyname(CTL_HW_FREQ, &mhz, &size, NULL, 0)) {
|
||||||
mhz = (int)(value / 1000000);
|
mhz /= 1000000;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mhz = SIGAR_FIELD_NOTIMPL;
|
mhz = SIGAR_FIELD_NOTIMPL;
|
||||||
|
|
Loading…
Reference in New Issue