aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-08-06 13:21:21 -0700
committerRob Landley <rob@landley.net>2019-08-09 20:35:09 -0500
commit99cfd03d8576de6ac760269f66eb37e3c732243f (patch)
tree57baaa5f094bed7fb644dc7a33a15ffdf96aacb3 /lib
parent5fbdad94ac145c59308200d689eea40e79a7ec5e (diff)
downloadtoybox-99cfd03d8576de6ac760269f66eb37e3c732243f.tar.gz
find: fix dangling symlink behavior.
ENOENT is ignored, but other errors are reported.
Diffstat (limited to 'lib')
-rw-r--r--lib/dirtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c
index c5cf654a..e44df66c 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -36,7 +36,7 @@ struct dirtree *dirtree_add_node(struct dirtree *parent, char *name, int flags)
int fd = parent ? parent->dirfd : AT_FDCWD;
if (fstatat(fd, name, &st,AT_SYMLINK_NOFOLLOW*!(flags&DIRTREE_SYMFOLLOW))) {
- if (flags&DIRTREE_STATLESS) statless++;
+ if ((flags&DIRTREE_STATLESS) && errno == ENOENT) statless++;
else goto error;
}
if (S_ISLNK(st.st_mode)) {