Skip to content

Commit 99e8d1f

Browse files
committed
CPU (Linux): loosely detect cpu name of unknown platform
1 parent 263d290 commit 99e8d1f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/detection/cpu/cpu_linux.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ static const char* parseCpuInfo(
303303
(cpuImplementer->length == 0 && ffParsePropLine(line, "CPU implementer :", cpuImplementer)) ||
304304
(cpu->name.length == 0 && ffParsePropLine(line, "Hardware :", &cpu->name)) || //For Android devices
305305
#elif __powerpc__ || __powerpc
306-
(cpuMHz->length == 0 && ffParsePropLine(line, "clock :", cpuMHz)) || //For POWER
307-
(cpu->name.length == 0 && ffParsePropLine(line, "cpu :", &cpu->name)) || //For POWER
306+
(cpuMHz->length == 0 && ffParsePropLine(line, "clock :", cpuMHz)) ||
307+
(cpu->name.length == 0 && ffParsePropLine(line, "cpu :", &cpu->name)) ||
308308
#elif __mips__ || __mips
309-
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) || //For MIPS
309+
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) ||
310310
#elif __loongarch__
311311
(cpu->name.length == 0 && ffParsePropLine(line, "Model Name :", &cpu->name)) ||
312312
(cpuMHz->length == 0 && ffParsePropLine(line, "CPU MHz :", cpuMHz)) ||
@@ -319,6 +319,10 @@ static const char* parseCpuInfo(
319319
(cpuMHz->length == 0 && ffParsePropLine(line, "cpu MHz static :", cpuMHz)) || // This one cannot be detected because of early return
320320
#else
321321
(cpu->name.length == 0 && ffParsePropLine(line, "model name :", &cpu->name)) ||
322+
(cpu->name.length == 0 && ffParsePropLine(line, "model :", &cpu->name)) ||
323+
(cpu->name.length == 0 && ffParsePropLine(line, "cpu model :", &cpu->name)) ||
324+
(cpu->name.length == 0 && ffParsePropLine(line, "hardware :", &cpu->name)) ||
325+
(cpu->name.length == 0 && ffParsePropLine(line, "processor :", &cpu->name)) ||
322326
#endif
323327

324328
false

0 commit comments

Comments
 (0)