aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2018-02-01 09:29:05 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-02-14 17:38:29 +0100
commitce5ba9277b5b712c18208f8116edc2dcfa490e43 (patch)
treee280b12dd6172c0a10a9ad69217dd023bc272788 /include
parent20f02c3c871cf0c8d9d2f2dad11d96c0ea41e0df (diff)
downloadbusybox-w32-ce5ba9277b5b712c18208f8116edc2dcfa490e43.tar.gz
busybox-w32-ce5ba9277b5b712c18208f8116edc2dcfa490e43.tar.bz2
busybox-w32-ce5ba9277b5b712c18208f8116edc2dcfa490e43.zip
cp: implement -T
Implement "cp -T". Some Linux kernel Makefiles started using this recently, so allow also building on systems using busybox cp. function old new delta cp_main 360 428 +68 copy_file 1678 1676 -2 packed_usage 32290 32259 -31 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 76/-39) Total: 35 bytes Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index daccf154a..1dbec3d0f 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -404,10 +404,11 @@ enum { /* cp.c, mv.c, install.c depend on these values. CAREFUL when changing th
404 /* -P = -d (mapped in cp.c) */ 404 /* -P = -d (mapped in cp.c) */
405 FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, /* -v */ 405 FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, /* -v */
406 FILEUTILS_UPDATE = 1 << 13, /* -u */ 406 FILEUTILS_UPDATE = 1 << 13, /* -u */
407 FILEUTILS_NO_TARGET_DIR = 1 << 14, /* -T */
407#if ENABLE_SELINUX 408#if ENABLE_SELINUX
408 FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 14, /* -c */ 409 FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 15, /* -c */
409#endif 410#endif
410 FILEUTILS_RMDEST = 1 << (15 - !ENABLE_SELINUX), /* --remove-destination */ 411 FILEUTILS_RMDEST = 1 << (16 - !ENABLE_SELINUX), /* --remove-destination */
411 /* 412 /*
412 * Hole. cp may have some bits set here, 413 * Hole. cp may have some bits set here,
413 * they should not affect remove_file()/copy_file() 414 * they should not affect remove_file()/copy_file()
@@ -417,7 +418,7 @@ enum { /* cp.c, mv.c, install.c depend on these values. CAREFUL when changing th
417#endif 418#endif
418 FILEUTILS_IGNORE_CHMOD_ERR = 1 << 31, 419 FILEUTILS_IGNORE_CHMOD_ERR = 1 << 31,
419}; 420};
420#define FILEUTILS_CP_OPTSTR "pdRfilsLHarPvu" IF_SELINUX("c") 421#define FILEUTILS_CP_OPTSTR "pdRfilsLHarPvuT" IF_SELINUX("c")
421extern int remove_file(const char *path, int flags) FAST_FUNC; 422extern int remove_file(const char *path, int flags) FAST_FUNC;
422/* NB: without FILEUTILS_RECUR in flags, it will basically "cat" 423/* NB: without FILEUTILS_RECUR in flags, it will basically "cat"
423 * the source, not copy (unless "source" is a directory). 424 * the source, not copy (unless "source" is a directory).