diff options
Diffstat (limited to 'lib/libc/gen/fts.c')
-rw-r--r-- | lib/libc/gen/fts.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index 1ca8334..7635fbc 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -905,13 +905,12 @@ 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)) { - p->fts_errno = saved_errno; - goto err; - } - errno = 0; - if (S_ISLNK(sbp->st_mode)) + if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { + errno = 0; return (FTS_SLNONE); + } + p->fts_errno = saved_errno; + goto err; } } else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { p->fts_errno = errno; |