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. --- toys/posix/find.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'toys/posix') diff --git a/toys/posix/find.c b/toys/posix/find.c index 5fc9b0ce..782cc3bc 100644 --- a/toys/posix/find.c +++ b/toys/posix/find.c @@ -211,7 +211,8 @@ static int do_find(struct dirtree *new) struct double_list *argdata = TT.argdata; char *s, **ss; - recurse = DIRTREE_COMEAGAIN|(DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_L)); + recurse = DIRTREE_STATLESS|DIRTREE_COMEAGAIN| + (DIRTREE_SYMFOLLOW*!!(toys.optflags&FLAG_L)); // skip . and .. below topdir, handle -xdev and -depth if (new) { @@ -669,7 +670,8 @@ void find_main(void) // Loop through paths for (i = 0; i < len; i++) - dirtree_flagread(ss[i], DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L)), + dirtree_flagread(ss[i], + DIRTREE_STATLESS|(DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L))), do_find); execdir(0, 1); -- cgit v1.2.3