diff options
author | Elliott Hughes <enh@google.com> | 2019-08-06 13:21:21 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-08-09 20:35:09 -0500 |
commit | 99cfd03d8576de6ac760269f66eb37e3c732243f (patch) | |
tree | 57baaa5f094bed7fb644dc7a33a15ffdf96aacb3 /lib | |
parent | 5fbdad94ac145c59308200d689eea40e79a7ec5e (diff) | |
download | toybox-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.c | 2 |
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)) { |