From 5c13851e62eaf01fa69985668085529b62f1521b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 8 Feb 2003 18:19:57 +0000 Subject: [PATCH] (ftw_startup): Don't shadow outer declaration of save_err. Merge inconsequential changes from libc. --- lib/ftw.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/ftw.c b/lib/ftw.c index b3dd2fc706..5ae747df22 100644 --- a/lib/ftw.c +++ b/lib/ftw.c @@ -38,9 +38,9 @@ char *alloca (); #if defined _LIBC # include -# define NAMLEN(dirent) _D_EXACT_NAMLEN(dirent) +# define NAMLEN(dirent) _D_EXACT_NAMLEN (dirent) #else -# if HAVE_DIRENT_H || defined _LIBC +# if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen ((dirent)->d_name) # else @@ -93,20 +93,23 @@ char *stpcpy (); # define __closedir closedir # undef __fchdir # define __fchdir fchdir +# undef __getcwd +# define __getcwd(P, N) xgetcwd () +extern char *xgetcwd (void); +# undef __mempcpy +# define __mempcpy mempcpy # undef __opendir # define __opendir opendir # undef __readdir64 # define __readdir64 readdir +# undef __stpcpy +# define __stpcpy stpcpy # undef __tdestroy # define __tdestroy tdestroy # undef __tfind # define __tfind tfind # undef __tsearch # define __tsearch tsearch -# undef __stpcpy -# define __stpcpy stpcpy -# undef __mempcpy -# define __mempcpy mempcpy # undef internal_function # define internal_function /* empty */ # undef dirent64 @@ -115,12 +118,6 @@ char *stpcpy (); # define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif -#ifndef _LIBC -# undef __getcwd -# define __getcwd(P, N) xgetcwd () -extern char *xgetcwd (void); -#endif - /* Arrange to make lstat calls go through the wrapper function on systems with an lstat function that does not dereference symlinks that are specified with a trailing slash. */ @@ -430,7 +427,7 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name, if (result == 0 && (data->flags & FTW_CHDIR)) { - /* Change back to parent directory. */ + /* Change back to the parent directory. */ int done = 0; if (dir->stream != NULL) if (__fchdir (dirfd (dir->stream)) == 0) @@ -773,7 +770,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors, /* Return to the start directory (if necessary). */ if (cwd != NULL) { - int save_err = errno; + save_err = errno; __chdir (cwd); free (cwd); __set_errno (save_err); -- 2.47.2