]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
avoid global variable shadowed
authorHu Tao <hutao@cn.fujitsu.com>
Fri, 2 Mar 2012 02:52:59 +0000 (10:52 +0800)
committerEric Blake <eblake@redhat.com>
Fri, 2 Mar 2012 03:09:23 +0000 (20:09 -0700)
If "conf/domain_conf.h" included in file nodeinfo.c, gcc complains about
a variable shadowing. fix it for potential further including of the file.

ref: https://www.redhat.com/archives/libvir-list/2012-February/msg00955.html

src/nodeinfo.c

index e0b66f71188b96dc4555a198f2a2a7433ae6f081..0c86a7eb90ca970c290a67ac8f660d8013098316 100644 (file)
@@ -206,7 +206,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
     DIR *cpudir = NULL;
     struct dirent *cpudirent = NULL;
     unsigned int cpu;
-    unsigned long core, socket, cur_threads;
+    unsigned long core, sock, cur_threads;
     cpu_set_t core_mask;
     cpu_set_t socket_mask;
     int online;
@@ -311,9 +311,9 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
         }
 
         /* Parse socket */
-        socket = parse_socket(cpu);
-        if (!CPU_ISSET(socket, &socket_mask)) {
-            CPU_SET(socket, &socket_mask);
+        sock = parse_socket(cpu);
+        if (!CPU_ISSET(sock, &socket_mask)) {
+            CPU_SET(sock, &socket_mask);
             nodeinfo->sockets++;
         }