diff options
author | Jim Meyering <jim@meyering.net> | 2006-01-11 21:00:36 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-01-11 21:00:36 +0000 |
commit | cf6281916bdc0d518887392240dfa26690385815 (patch) | |
tree | 864a92e626e88d772d93df027d06a3592b294488 /lib | |
parent | e51c87a60401c1738dcbfa92d5f8c8c36a6b6043 (diff) | |
download | coreutils-cf6281916bdc0d518887392240dfa26690385815.tar.xz |
(fts_stat): When following a symlink-to-directory,
don't interpret all stat-fails+lstat-succeeds as indicating a
dangling symlink. That can also happen at least for ELOOP.
The fix: return FTS_SLNONE only when the stat errno is ENOENT.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fts.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1069,7 +1069,8 @@ fts_stat(FTS *sp, register FTSENT *p, bool follow) if (ISSET(FTS_LOGICAL) || follow) { if (stat(p->fts_accpath, sbp)) { saved_errno = errno; - if (!lstat(p->fts_accpath, sbp)) { + if (errno == ENOENT + && lstat(p->fts_accpath, sbp) == 0) { __set_errno (0); return (FTS_SLNONE); } |