mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +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:
@@ -50,8 +50,8 @@ struct topology* get_topology_info(struct cache* cach) {
|
||||
|
||||
// 1. Total cores detection
|
||||
if((topo->total_cores = sysconf(_SC_NPROCESSORS_ONLN)) == -1) {
|
||||
perror("sysconf");
|
||||
return NULL;
|
||||
printWarn("sysconf(_SC_NPROCESSORS_ONLN): %s", strerror(errno));
|
||||
topo->total_cores = 1; // fallback
|
||||
}
|
||||
|
||||
// To find physical cores, we use topo->total_cores and core_ids
|
||||
|
||||
Reference in New Issue
Block a user