aboutsummaryrefslogtreecommitdiffstats
path: root/main/libvirt/nodeinfo-musl.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-10 13:18:52 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-04-10 14:05:07 +0000
commitc75bffeb5a2b09ed51bb6f8d7e57e64ee6f96a9e (patch)
treed4ba8f8cfda6f3022de2edad5ae661abc0c2ae35 /main/libvirt/nodeinfo-musl.patch
parent3ae8433b8ff0729934a9ba3779a6f426aceb8bfd (diff)
downloadaports-c75bffeb5a2b09ed51bb6f8d7e57e64ee6f96a9e.tar.bz2
aports-c75bffeb5a2b09ed51bb6f8d7e57e64ee6f96a9e.tar.xz
main/libvirt: fix 'virsh nodeinfo' for musl
Diffstat (limited to 'main/libvirt/nodeinfo-musl.patch')
-rw-r--r--main/libvirt/nodeinfo-musl.patch61
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) {