From 3363c34bcfa5853f8718536d7b726506a4103273 Mon Sep 17 00:00:00 2001 From: jay Date: Sun, 5 Dec 2004 16:49:51 +0000 Subject: [PATCH] Avoid duplicate error message when we cannot chdir() into a subdirectory. --- find/find.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/find/find.c b/find/find.c index f2af6d9..0bea189 100644 --- a/find/find.c +++ b/find/find.c @@ -916,6 +916,7 @@ safely_chdir(const char *dest, { rv = SafeChdirFailChdirFailed; rv_set = true; + name = specific_dirname(dest); } goto fail; } @@ -947,9 +948,16 @@ safely_chdir(const char *dest, fail: if (saved_errno) { + errno = saved_errno; + + /* do not call error() as this would result in a duplicate error message + * when the caller does the same thing. + */ +#if 0 if (NULL == name) name = specific_dirname("."); error(0, saved_errno, "%s", name); +#endif } free(name); -- 2.11.4.GIT