CPU (FreeBSD): don't display 0.00 GHz

This commit is contained in:
Carter Li
2024-03-15 11:15:23 +08:00
parent 586874080f
commit 55ae3a7dbd
+2 -1
View File
@@ -11,7 +11,8 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
cpu->coresLogical = cpu->coresPhysical;
cpu->coresOnline = cpu->coresPhysical;
cpu->frequencyBase = ffSysctlGetInt("hw.clockrate", 0) / 1000.0;
int clockRate = ffSysctlGetInt("hw.clockrate", 0);
cpu->frequencyBase = clockRate <= 0 ? 0.0/0.0 : clockRate / 1000.0;
cpu->temperature = FF_CPU_TEMP_UNSET;
if (options->temp)