public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] lscpu: fix shadow declaration [smatch scan]
@ 2013-07-28 21:11 Sami Kerola
  2013-07-28 21:11 ` [PATCH 2/7] setarch: prefer preprocessor rather than autotools check Sami Kerola
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Sami Kerola @ 2013-07-28 21:11 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index fbaaa31..98cee16 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -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
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-01 11:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-28 21:11 [PATCH 1/7] lscpu: fix shadow declaration [smatch scan] Sami Kerola
2013-07-28 21:11 ` [PATCH 2/7] setarch: prefer preprocessor rather than autotools check Sami Kerola
2013-07-28 21:11 ` [PATCH 3/7] build-sys: use m4 quoting consistently Sami Kerola
2013-07-28 21:11 ` [PATCH 4/7] build-sys: prefer AS_CASE rather than shell 'case' Sami Kerola
2013-07-28 21:11 ` [PATCH 5/7] build-sys: prefer AS_IF rather than shell 'if' Sami Kerola
2013-07-28 21:11 ` [PATCH 6/7] build-sys: use backticks rather than $() for commands in configure Sami Kerola
2013-07-28 21:11 ` [PATCH 7/7] rev: use string printing rather than character output Sami Kerola
2013-08-01 11:41 ` [PATCH 1/7] lscpu: fix shadow declaration [smatch scan] Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox