[v0.98][Refactoring] Use printWarn + strerror(errno) instead of perror. Use fallback in ppc in case total_cores cannot be retrieved

This commit is contained in:
Dr-Noob
2021-08-07 08:43:46 +02:00
parent c24dd7cbb6
commit 2b21326167
5 changed files with 19 additions and 21 deletions

View File

@@ -435,7 +435,7 @@ struct topology* get_topology_info(struct cpuInfo* cpu, struct cache* cach) {
topo->total_cores = info.dwNumberOfProcessors;
#else
if((topo->total_cores = sysconf(_SC_NPROCESSORS_ONLN)) == -1) {
perror("sysconf");
printWarn("sysconf(_SC_NPROCESSORS_ONLN): %s", strerror(errno));
topo->total_cores = topo->logical_cores; // fallback
}
#endif