Skip to content

Commit

Permalink
libnuma: clear errno at the end of numa_init
Browse files Browse the repository at this point in the history
The construct function numa_init may change errno value
before main function, which can be confuse.

Fixes: d538c64("libnuma: Query upcoming MPOL_PREFERRED_MANY support")
  • Loading branch information
Chunsheng Luo authored and andikleen committed Dec 14, 2022
1 parent 421d18c commit 097e362
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libnuma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 097e362

Please sign in to comment.