diff options
Diffstat (limited to 'main/libvirt/nodeinfo-musl.patch')
-rw-r--r-- | main/libvirt/nodeinfo-musl.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/main/libvirt/nodeinfo-musl.patch b/main/libvirt/nodeinfo-musl.patch new file mode 100644 index 0000000000..f7c855e6d9 --- /dev/null +++ b/main/libvirt/nodeinfo-musl.patch @@ -0,0 +1,61 @@ +diff --git a/src/nodeinfo.c b/src/nodeinfo.c +index 53ba716..8d3214e 100644 +--- a/src/nodeinfo.c ++++ b/src/nodeinfo.c +@@ -452,8 +452,7 @@ virNodeParseNode(const char *node, + + /* enumerate sockets in the node */ + CPU_ZERO(&sock_map); +- errno = 0; +- while ((cpudirent = readdir(cpudir))) { ++ for (errno = 0; (cpudirent = readdir(cpudir)); errno = 0) { + if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1) + continue; + +@@ -470,8 +469,6 @@ virNodeParseNode(const char *node, + + if (sock > sock_max) + sock_max = sock; +- +- errno = 0; + } + + if (errno) { +@@ -490,8 +487,7 @@ virNodeParseNode(const char *node, + + /* iterate over all CPU's in the node */ + rewinddir(cpudir); +- errno = 0; +- while ((cpudirent = readdir(cpudir))) { ++ for (errno = 0; (cpudirent = readdir(cpudir)); errno = 0) { + if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1) + continue; + +@@ -530,8 +526,6 @@ virNodeParseNode(const char *node, + + if (siblings > *threads) + *threads = siblings; +- +- errno = 0; + } + + if (errno) { +@@ -672,8 +666,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, + goto fallback; + } + +- errno = 0; +- while ((nodedirent = readdir(nodedir))) { ++ for (errno = 0; (nodedirent = readdir(nodedir)); errno = 0) { + if (sscanf(nodedirent->d_name, "node%u", &node) != 1) + continue; + +@@ -699,8 +692,6 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, + + if (threads > nodeinfo->threads) + nodeinfo->threads = threads; +- +- errno = 0; + } + + if (errno) { |