]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: fix shadow declaration [smatch scan]
authorSami Kerola <kerolasa@iki.fi>
Sun, 28 Jul 2013 21:11:15 +0000 (22:11 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 1 Aug 2013 11:35:24 +0000 (13:35 +0200)
sys-utils/lscpu.c:572:22: warning: symbol 'fd' shadows an earlier one

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/lscpu.c

index fbaaa31366c6dc64d96ae420661589cae69498e9..98cee16354921f6e7a94ae5b629be5a6757ce2a8 100644 (file)
@@ -569,15 +569,15 @@ read_hypervisor(struct lscpu_desc *desc, struct lscpu_modifier *mod)
 
        /* IBM PR/SM */
        } else if (path_exist(_PATH_PROC_SYSINFO)) {
-               FILE *fd = path_fopen("r", 0, _PATH_PROC_SYSINFO);
+               FILE *sysinfo_fd = path_fopen("r", 0, _PATH_PROC_SYSINFO);
                char buf[BUFSIZ];
 
-               if (!fd)
+               if (!sysinfo_fd)
                        return;
                desc->hyper = HYPER_IBM;
                desc->hypervisor = "PR/SM";
                desc->virtype = VIRT_FULL;
-               while (fgets(buf, sizeof(buf), fd) != NULL) {
+               while (fgets(buf, sizeof(buf), sysinfo_fd) != NULL) {
                        char *str;
 
                        if (!strstr(buf, "Control Program:"))
@@ -601,7 +601,7 @@ read_hypervisor(struct lscpu_desc *desc, struct lscpu_modifier *mod)
                        while ((str = strstr(desc->hypervisor, "  ")))
                                memmove(str, str + 1, strlen(str));
                }
-               fclose(fd);
+               fclose(sysinfo_fd);
        }
 
        /* OpenVZ/Virtuozzo - /proc/vz dir should exist