numactl/0001-libnuma-clear-errno-at-the-end-of-numa_init.patch
lijianglin b954a3c1ba fix the problem of some commands of memhog, migspeed and numactl failed to execute
(cherry picked from commit d81184f055d6f766d4da9f86c9714cf7c39b0f28)
2022-12-16 17:27:09 +08:00

31 lines
836 B
Diff

From 097e362c628a8d884fab15f84872810ae0cd41d6 Mon Sep 17 00:00:00 2001
From: Chunsheng Luo <luochunsheng@huawei.com>
Date: Sat, 10 Dec 2022 17:53:36 +0800
Subject: [PATCH] libnuma: clear errno at the end of numa_init
The construct function numa_init may change errno value
before main function, which can be confuse.
Fixes: d538c645("libnuma: Query upcoming MPOL_PREFERRED_MANY support")
---
libnuma.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libnuma.c b/libnuma.c
index e1a8001..b8e5603 100644
--- a/libnuma.c
+++ b/libnuma.c
@@ -106,6 +106,9 @@ numa_init(void)
for (i = 0; i < max; i++)
nodemask_set_compat((nodemask_t *)&numa_all_nodes, i);
memset(&numa_no_nodes, 0, sizeof(numa_no_nodes));
+
+ /* clear errno */
+ errno = 0;
}
static void cleanup_node_cpu_mask_v2(void);
--
2.33.0