Skip to content

Commit 4a7e60e

Browse files
committed
CPU (Linux): don't crash if /sys/devices/system/cpu/cpufreq/ doesn't exist
Ref: #750
1 parent 0a61403 commit 4a7e60e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/detection/cpu/cpu_linux.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ static bool detectFrequency(FFCPUResult* cpu)
107107
{
108108
FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateS("/sys/devices/system/cpu/cpufreq/");
109109
FF_AUTO_CLOSE_DIR DIR* dir = opendir(path.chars);
110+
if (!dir) return false;
111+
110112
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
111113
uint32_t baseLen = path.length;
112114
bool flag = false;

0 commit comments

Comments
 (0)