Index: lib/libc/gen/fts.c =================================================================== --- lib/libc/gen/fts.c (revision 280791) +++ lib/libc/gen/fts.c (working copy) @@ -905,12 +905,13 @@ if (ISSET(FTS_LOGICAL) || follow) { if (fstatat(dfd, path, sbp, 0)) { saved_errno = errno; - if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { - errno = 0; + if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { + p->fts_errno = saved_errno; + goto err; + } + errno = 0; + if (S_ISLNK(sbp->st_mode)) return (FTS_SLNONE); - } - p->fts_errno = saved_errno; - goto err; } } else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) { p->fts_errno = errno;