aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/cp.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/cp.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/cp.c')
-rw-r--r--toys/posix/cp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index 2959f67c..df8269f3 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -340,9 +340,9 @@ void cp_main(void)
// Skip nonexistent sources
if (rc) {
- int symfollow = toys.optflags & (FLAG_H|FLAG_L);
+ int symfollow = DIRTREE_SYMFOLLOW*!!(toys.optflags & (FLAG_H|FLAG_L));
- if (errno != EXDEV || !(new = dirtree_add_node(0, src, symfollow)))
+ if (errno != EXDEV || !(new = dirtree_start(src, symfollow)))
perror_msg("bad '%s'", src);
else dirtree_handle_callback(new, TT.callback);
}