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
This commit is contained in:
Hu Tao 2012-03-02 10:52:59 +08:00 committed by Eric Blake
parent 3c30fbcd4a
commit 362077e752

View 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++;
}