!1015 修复中文环境连接池绑核失败问题

Merge pull request !1015 from Hemny/fixBug1
This commit is contained in:
opengauss-bot
2021-07-09 06:19:28 +00:00
committed by Gitee

View File

@ -449,7 +449,7 @@ void ThreadPoolControler::GetCpuAndNumaNum()
FILE* fp = NULL;
if ((fp = popen("lscpu", "r")) != NULL) {
if ((fp = popen("LANG=en_US.UTF-8;lscpu", "r")) != NULL) {
while (fgets(buf, sizeof(buf), fp) != NULL) {
if (strncmp("CPU(s)", buf, strlen("CPU(s)")) == 0 &&
strncmp("On-line CPU(s) list", buf, strlen("On-line CPU(s) list")) != 0 &&