mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
libxl: Avoid a variable named 'stat'
Using a variable named 'stat' clashes with the system function 'stat()' causing compiler warnings on some platforms: libxl/libxl_driver.c: In function 'libxlDomainBlockStatsVBD': libxl/libxl_driver.c:5387: error: declaration of 'stat' shadows a global declaration [-Wshadow] /usr/include/sys/stat.h:455: error: shadowed declaration is here [-Wshadow] Signed-off-by: George Dunlap <george.dunlap@citrix.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
f8172388cc
commit
92b6c99223
@ -5374,7 +5374,7 @@ libxlDomainBlockStatsVBD(virDomainObjPtr vm,
|
||||
int devno = libxlDiskPathToID(dev);
|
||||
int size;
|
||||
char *path, *name, *val;
|
||||
unsigned long long stat;
|
||||
unsigned long long status;
|
||||
|
||||
path = name = val = NULL;
|
||||
if (devno < 0) {
|
||||
@ -5401,12 +5401,12 @@ libxlDomainBlockStatsVBD(virDomainObjPtr vm,
|
||||
# define LIBXL_SET_VBDSTAT(FIELD, VAR, MUL) \
|
||||
if ((virAsprintf(&name, "%s/"FIELD, path) < 0) || \
|
||||
(virFileReadAll(name, 256, &val) < 0) || \
|
||||
(sscanf(val, "%llu", &stat) != 1)) { \
|
||||
(sscanf(val, "%llu", &status) != 1)) { \
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, \
|
||||
_("cannot read %s"), name); \
|
||||
goto cleanup; \
|
||||
} \
|
||||
VAR += (stat * MUL); \
|
||||
VAR += (status * MUL); \
|
||||
VIR_FREE(name); \
|
||||
VIR_FREE(val);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user