aboutsummaryrefslogtreecommitdiff
path: root/toys
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 /toys
parent5fbdad94ac145c59308200d689eea40e79a7ec5e (diff)
downloadtoybox-99cfd03d8576de6ac760269f66eb37e3c732243f.tar.gz
find: fix dangling symlink behavior.
ENOENT is ignored, but other errors are reported.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/find.c6
1 files changed, 4 insertions, 2 deletions
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);