aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
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/pending
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/pending')
-rw-r--r--toys/pending/diff.c4
-rw-r--r--toys/pending/tar.c5
2 files changed, 3 insertions, 6 deletions
diff --git a/toys/pending/diff.c b/toys/pending/diff.c
index 1b3f80bb..80238614 100644
--- a/toys/pending/diff.c
+++ b/toys/pending/diff.c
@@ -768,7 +768,6 @@ void diff_main(void)
struct stat st[2];
int j = 0, k = 1, start[2] = {1, 1};
char *files[2];
- struct dirtree *root;
for (j = 0; j < 2; j++) {
files[j] = toys.optargs[j];
@@ -799,8 +798,7 @@ void diff_main(void)
if (S_ISDIR(st[0].st_mode) && S_ISDIR(st[1].st_mode)) {
for (j = 0; j < 2; j++) {
memset(&dir[j], 0, sizeof(dir));
- root = dirtree_add_node(0, files[j], 1);
- if (root) dirtree_handle_callback(root, list_dir);
+ dirtree_handle_callback(dirtree_start(files[j], 1), list_dir);
dir[j].nr_elm = TT.size; //size updated in list_dir
qsort(&(dir[j].list[1]), (TT.size - 1), sizeof(char*), cmp);
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);