diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2015-04-04 20:22:12 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2015-04-04 20:22:12 +0000 |
commit | d30c6f8edf7b7a6960e87f9d2238250c9434039f (patch) | |
tree | 7b757a26ad5447d761715965487d10dfa6828a78 | |
parent | b0aa40ed2911f043c51c68ff0179a66f3a15ccc6 (diff) |
Notes
-rw-r--r-- | lib/libc/gen/fts.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index 7635fbc352635..1ca8334acc680 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -905,12 +905,13 @@ fts_stat(FTS *sp, FTSENT *p, int follow, int dfd) if (ISSET(FTS_LOGICAL) || follow) { if (fstatat(dfd, path, sbp, 0)) { saved_errno = errno; - if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { - errno = 0; - return (FTS_SLNONE); + if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { + p->fts_errno = saved_errno; + goto err; } - p->fts_errno = saved_errno; - goto err; + errno = 0; + if (S_ISLNK(sbp->st_mode)) + return (FTS_SLNONE); } } else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { p->fts_errno = errno; |