cpu model name fixups

This commit is contained in:
Doug MacEachern 2004-07-09 20:44:39 +00:00
parent d26c16affa
commit c51d4f15d4
1 changed files with 11 additions and 9 deletions

View File

@ -1194,7 +1194,7 @@ int sigar_cpu_infos_get(sigar_t *sigar,
for (i=0; i<ncpu; i++) { for (i=0; i<ncpu; i++) {
sigar_cpu_info_t *info; sigar_cpu_info_t *info;
char *arch, *model; char *arch, *model=NULL;
SIGAR_CPU_INFOS_GROW(cpu_infos); SIGAR_CPU_INFOS_GROW(cpu_infos);
@ -1209,13 +1209,13 @@ int sigar_cpu_infos_get(sigar_t *sigar,
arch = "Power Classic"; arch = "Power Classic";
break; break;
case POWER_PC: case POWER_PC:
arch = "Power PC"; arch = "PowerPC";
break; break;
case IA64: case IA64:
arch = "IA64"; arch = "IA64";
break; break;
default: default:
arch = "unknown"; arch = "PowerPC"; /* what else could it be */
break; break;
} }
@ -1266,7 +1266,6 @@ int sigar_cpu_infos_get(sigar_t *sigar,
model = "POWER5"; model = "POWER5";
break; break;
default: default:
model = "unknown";
break; break;
} }
} }
@ -1281,19 +1280,22 @@ int sigar_cpu_infos_get(sigar_t *sigar,
model = "M2"; model = "M2";
break; break;
default: default:
model = "unknown";
break; break;
} }
} }
else { else {
SIGAR_SSTRCPY(info->vendor, "Unknown"); SIGAR_SSTRCPY(info->vendor, "IBM");
model = "unknown";
break; break;
} }
if (model) {
snprintf(info->model, sizeof(info->model), snprintf(info->model, sizeof(info->model),
"%s %s", arch, model); "%s %s", arch, model);
} }
else {
SIGAR_SSTRCPY(info->model, arch);
}
}
return SIGAR_OK; return SIGAR_OK;
} }