From 99cfd03d8576de6ac760269f66eb37e3c732243f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 6 Aug 2019 13:21:21 -0700 Subject: find: fix dangling symlink behavior. ENOENT is ignored, but other errors are reported. --- lib/dirtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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)) { -- cgit v1.2.3