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/pending/tar.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'toys/pending/tar.c') diff --git a/toys/pending/tar.c b/toys/pending/tar.c index f44465cc..c8b6dff8 100644 --- a/toys/pending/tar.c +++ b/toys/pending/tar.c @@ -788,9 +788,8 @@ void tar_main(void) for (tmp = TT.inc; tmp; tmp = tmp->next) { TT.handle = tar_hdl; //recurse thru dir and add files to archive - struct dirtree *root = dirtree_add_node(0,tmp->arg,toys.optflags & FLAG_h); - - if (root) dirtree_handle_callback(root, add_to_tar); + dirtree_handle_callback(dirtree_start(tmp->arg, toys.optflags & FLAG_h), + add_to_tar); } memset(toybuf, 0, 1024); writeall(tar_hdl->src_fd, toybuf, 1024); -- cgit v1.2.3