From d10dd2095a4464a6e6f3002b27f263210220ab39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 21 Aug 2024 15:46:12 +0800 Subject: [PATCH] CPU (Android): try support old armv7 smart phone Fix #1202 --- src/detection/cpu/cpu_linux.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/detection/cpu/cpu_linux.c b/src/detection/cpu/cpu_linux.c index 39efe3fbe..74d09bc16 100644 --- a/src/detection/cpu/cpu_linux.c +++ b/src/detection/cpu/cpu_linux.c @@ -144,8 +144,12 @@ static const char* parseCpuInfo(FILE* cpuinfo, FFCPUResult* cpu, FFstrbuf* physi while(getline(&line, &len, cpuinfo) != -1) { - //Stop after the first CPU - if(*line == '\0' || *line == '\n') + //Stop after reasonable information is acquired + if((*line == '\0' || *line == '\n') + #if __ANDROID__ && __arm__ + && cpu->name.length > 0 // #1202 + #endif + ) break; (void)( @@ -157,7 +161,7 @@ static const char* parseCpuInfo(FILE* cpuinfo, FFCPUResult* cpu, FFstrbuf* physi ffParsePropLine(line, "uarch :", cpuUarch) || #if __arm__ || __aarch64__ - (cpu->vendor.length == 0 && ffParsePropLine(line, "CPU implementer :", cpuImplementer)) || + (cpuImplementer->length == 0 && ffParsePropLine(line, "CPU implementer :", cpuImplementer)) || #endif #if __ANDROID__ (cpu->name.length == 0 && ffParsePropLine(line, "Hardware :", &cpu->name)) || //For Android devices