From b7c5adae3d0a5567e71ae4ecd5da71721fd71227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B1=E9=9B=B2=E3=81=AA=E3=81=AE?= <87938880+4Darmygeometry@users.noreply.github.com> Date: Sat, 28 Dec 2024 23:34:19 +0800 Subject: [PATCH] Use uname -m to get CPU architecture (#2222) Use uname -m to get CPU architecture is simplier than lscpu --- src/tools/my_cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c index dd7065dad..f69656fcd 100644 --- a/src/tools/my_cpuid.c +++ b/src/tools/my_cpuid.c @@ -152,7 +152,7 @@ const char* getCpuName() } } // failled, try to get architecture at least - f = popen("LC_ALL=C lscpu | grep -i \"architecture:\" | head -n 1 | sed -r 's/(architecture:)\\s{1,}//gi'", "r"); + f = popen("uname -m", "r"); if(f) { char tmp[200] = ""; ssize_t s = fread(tmp, 1, 200, f);