numactl/0001-libnuma-clear-errno-at-the-end-of-numa_init.patch

31 lines
836 B
Diff
Raw Normal View History

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