From aab9164df395a4b0878b0ad930a5ec8a806a58e9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 9 May 2015 18:11:22 -0500 Subject: 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). --- toys/posix/find.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'toys/posix/find.c') 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); -- cgit v1.2.3