From: Hu Tao Date: Fri, 2 Mar 2012 02:52:59 +0000 (+0800) Subject: avoid global variable shadowed X-Git-Tag: v0.9.11-rc1~173 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=362077e752135daba5e8e065306cc373fb94dfc6;p=thirdparty%2Flibvirt.git avoid global variable shadowed 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 --- diff --git a/src/nodeinfo.c b/src/nodeinfo.c index e0b66f7118..0c86a7eb90 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -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++; }