mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user