lscpu: fix variable shadowing

sys-utils/lscpu-virt.c: In function ‘lscpu_read_virtualization’:
    sys-utils/lscpu-virt.c:574:9: warning: declaration of ‘buf’ shadows a previous local [-Wshadow]
      574 |    char buf[256];
          |         ^~~
    sys-utils/lscpu-virt.c:506:7: note: shadowed declaration is here
      506 |  char buf[BUFSIZ];
          |       ^~~

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2020-11-26 16:54:50 +00:00
parent e69cb8b91d
commit 01258182bb
No known key found for this signature in database
GPG Key ID: 0D46FEF7E61DBB46
1 changed files with 3 additions and 3 deletions

View File

@ -571,10 +571,10 @@ struct lscpu_virt *lscpu_read_virtualization(struct lscpu_cxt *cxt)
fd = ul_path_fopen(cxt->procfs, "r", "xen/capabilities");
if (fd) {
char buf[256];
char xenbuf[256];
if (fscanf(fd, "%255s", buf) == 1 &&
!strcmp(buf, "control_d"))
if (fscanf(fd, "%255s", xenbuf) == 1 &&
!strcmp(xenbuf, "control_d"))
dom0 = 1;
fclose(fd);
}