[PATCH] domain_conf: silence gcc warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



../../src/conf/domain_conf.c:10949: error: declaration of 'socket'
shadows a global declaration [-Wshadow]

../../src/conf/domain_conf.c:24373: error: declaration of 'listen'
shadows a global declaration [-Wshadow]

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---

This breaks a build on CentOS 6, pushed under build-breaker rule.

 src/conf/domain_conf.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 85f6e31..10e61da 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10946,7 +10946,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
     char *type = virXMLPropString(node, "type");
     char *address = virXMLPropString(node, "address");
     char *network = virXMLPropString(node, "network");
-    char *socket = virXMLPropString(node, "socket");
+    char *socketPath = virXMLPropString(node, "socket");
     char *fromConfig = virXMLPropString(node, "fromConfig");
     char *addressCompat = NULL;
     char *socketCompat = NULL;
@@ -11012,16 +11012,16 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
     }
 
     if (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) {
-        if (socket && socketCompat && STRNEQ(socket, socketCompat)) {
+        if (socketPath && socketCompat && STRNEQ(socketPath, socketCompat)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("graphics 'socket' attribute '%s' must match "
                              "'socket' attribute of first listen element "
-                             "(found '%s')"), socketCompat, socket);
+                             "(found '%s')"), socketCompat, socketPath);
             goto error;
         }
 
-        if (!socket) {
-            socket = socketCompat;
+        if (!socketPath) {
+            socketPath = socketCompat;
             socketCompat = NULL;
         }
     }
@@ -11045,15 +11045,15 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
         network = NULL;
     }
 
-    if (socket && socket[0]) {
+    if (socketPath && socketPath[0]) {
         if (def->type != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) {
             virReportError(VIR_ERR_XML_ERROR, "%s",
                            _("'socket' attribute is valid only for listen "
                              "type 'socket'"));
             goto error;
         }
-        def->socket = socket;
-        socket = NULL;
+        def->socket = socketPath;
+        socketPath = NULL;
     }
 
     if (fromConfig &&
@@ -11074,7 +11074,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
     VIR_FREE(type);
     VIR_FREE(address);
     VIR_FREE(network);
-    VIR_FREE(socket);
+    VIR_FREE(socketPath);
     VIR_FREE(fromConfig);
     VIR_FREE(addressCompat);
     VIR_FREE(socketCompat);
@@ -24368,24 +24368,24 @@ virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def,
 
 int
 virDomainGraphicsListenAppendSocket(virDomainGraphicsDefPtr def,
-                                    const char *socket)
+                                    const char *socketPath)
 {
-    virDomainGraphicsListenDef listen;
+    virDomainGraphicsListenDef glisten;
 
-    memset(&listen, 0, sizeof(listen));
+    memset(&glisten, 0, sizeof(glisten));
 
-    listen.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET;
+    glisten.type = VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET;
 
-    if (VIR_STRDUP(listen.socket, socket) < 0)
+    if (VIR_STRDUP(glisten.socket, socketPath) < 0)
         goto error;
 
-    if (VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, listen) < 0)
+    if (VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, glisten) < 0)
         goto error;
 
     return 0;
 
  error:
-    VIR_FREE(listen.socket);
+    VIR_FREE(glisten.socket);
     return -1;
 }
 
-- 
2.8.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]