[git commit] Don't shadow stat with a local variable

Ron ron at debian.org
Fri Jun 26 19:14:24 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=41167151599307ea9574a5342e7e030779424e25
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl


Signed-off-by: Ron Lee <ron at debian.org>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 utils/ldconfig.c |   10 +++++-----
 utils/ldd.c      |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/utils/ldconfig.c b/utils/ldconfig.c
index c30416b..6c2362a 100644
--- a/utils/ldconfig.c
+++ b/utils/ldconfig.c
@@ -585,18 +585,18 @@ static char *get_extpath(void)
 {
 	char *res = NULL, *cp;
 	FILE *file;
-	struct stat stat;
+	struct stat st;
 	char realconffile[BUFFER_SIZE];
 
 	if (!chroot_realpath(chroot_dir, conffile, realconffile))
 		return NULL;
 
 	if ((file = fopen(realconffile, "r")) != NULL) {
-		fstat(fileno(file), &stat);
-		res = xmalloc(stat.st_size + 1);
-		fread(res, 1, stat.st_size, file);
+		fstat(fileno(file), &st);
+		res = xmalloc(st.st_size + 1);
+		fread(res, 1, st.st_size, file);
 		fclose(file);
-		res[stat.st_size] = '\0';
+		res[st.st_size] = '\0';
 
 		/* convert comments fo spaces */
 		for (cp = res; *cp; /*nada */ ) {
diff --git a/utils/ldd.c b/utils/ldd.c
index 9874a30..41da973 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -707,8 +707,8 @@ foo:
 	    && ehdr->e_ident[EI_VERSION] == EV_CURRENT
 	    && MATCH_MACHINE(ehdr->e_machine))
 	{
-		struct stat statbuf;
-		if (stat(interp->path, &statbuf) == 0 && S_ISREG(statbuf.st_mode)) {
+		struct stat st;
+		if (stat(interp->path, &st) == 0 && S_ISREG(st.st_mode)) {
 			pid_t pid;
 			int status;
 			static const char *const environment[] = {
-- 
1.6.3.3


More information about the uClibc-cvs mailing list