OSDN Git Service

Don't shadow stat with a local variable
authorRon <ron@debian.org>
Fri, 26 Jun 2009 19:14:24 +0000 (04:44 +0930)
committerMike Frysinger <vapier@gentoo.org>
Mon, 6 Jul 2009 00:27:17 +0000 (20:27 -0400)
Signed-off-by: Ron Lee <ron@debian.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
utils/ldconfig.c
utils/ldd.c

index 505316b..139b5f9 100644 (file)
@@ -558,18 +558,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 */ ) {
index 02b37f1..e7a94cb 100644 (file)
@@ -683,8 +683,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[] = {