This commit is contained in:
Jos Dehaes 2021-10-06 16:00:41 +02:00
parent b9d58e3faf
commit c7f1e71e29

View file

@ -270,7 +270,7 @@ namespace Cpu {
mib[1] = HW_CPU_FREQ;
if (sysctl(mib, 2, &freq, &size, NULL, 0) < 0) {
Logger::error("Failed to get CPU frequency: " + std::to_string(errno));
// this fails on Apple Silicon macs. Apparently you're not allowed to know
return "";
}
return std::to_string(freq / 1000.0 / 1000.0 / 1000.0).substr(0, 3);