7 Star 0 Fork 18

src-openEuler/numactl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-libnuma-Fix-unexpected-output.patch 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
From e763e8c86d9f10761a75c2be8510a79f25d63831 Mon Sep 17 00:00:00 2001
From: Chunsheng Luo <luochunsheng@ustc.edu>
Date: Thu, 25 Jan 2024 23:54:56 +0800
Subject: [PATCH] libnuma: Fix unexpected output
When errno is 0, numa_error(__FILE__) will print "xx: Success",
which is not as expected
Signed-off-by: Chunsheng Luo <luochunsheng@ustc.edu>
Reported-by: Ajay Panyala
Conflict: NA
Reference:https://github.com/numactl/numactl/commit/e763e8c86d9f10761a75c2be8510a79f25d63831
---
libnuma.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/libnuma.c b/libnuma.c
index 8b07ab0..e898297 100644
--- a/libnuma.c
+++ b/libnuma.c
@@ -1882,8 +1882,10 @@ static struct bitmask *__numa_preferred(void)
policy != MPOL_BIND)
return bmp;
- if (numa_bitmask_weight(bmp) > 1)
+ if (numa_bitmask_weight(bmp) > 1) {
+ errno = EINVAL;
numa_error(__FILE__);
+ }
return bmp;
}
@@ -1903,8 +1905,11 @@ int numa_preferred(void)
static void __numa_set_preferred(struct bitmask *bmp)
{
int nodes = numa_bitmask_weight(bmp);
- if (nodes > 1)
+ if (nodes > 1) {
+ errno = EINVAL;
numa_error(__FILE__);
+ }
+
setpol(nodes ? MPOL_PREFERRED : MPOL_LOCAL, bmp);
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/numactl.git
git@gitee.com:src-openeuler/numactl.git
src-openeuler
numactl
numactl
master

搜索帮助