aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/find.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-05-09 18:11:22 -0500
committerRob Landley <rob@landley.net>2015-05-09 18:11:22 -0500
commitaab9164df395a4b0878b0ad930a5ec8a806a58e9 (patch)
treeae36c520e5ebeaf616755792f67c9e09ff1bbf9f /toys/posix/find.c
parenta913d92bad6550e005a3ffac71a82586042171b5 (diff)
downloadtoybox-aab9164df395a4b0878b0ad930a5ec8a806a58e9.tar.gz
Add DIRTREE_SHUTUP to disable dirtree warnings if file vanishes out from
under traversal. Pass through full flag set in dirtree_add_node(), add dirtree_start() wrapper to provide symlink-only behavior (avoiding a lot of DIRTREE_SYMFOLLOW*!!(logic) repeated in callers).
Diffstat (limited to 'toys/posix/find.c')
-rw-r--r--toys/posix/find.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 69e370d4..73502b4a 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -531,12 +531,9 @@ void find_main(void)
do_find(0);
// Loop through paths
- for (i = 0; i < len; i++) {
- struct dirtree *new;
-
- new = dirtree_add_node(0, ss[i], toys.optflags&(FLAG_H|FLAG_L));
- if (new) dirtree_handle_callback(new, do_find);
- }
+ for (i = 0; i < len; i++)
+ dirtree_handle_callback(dirtree_start(ss[i], toys.optflags&(FLAG_H|FLAG_L)),
+ do_find);
if (CFG_TOYBOX_FREE) {
close(TT.topdir);