summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2010-10-26 17:55:10 +0100
committerPádraig Brady <P@draigBrady.com>2010-10-27 11:18:51 +0100
commit883ac22239036025896ff99bd4b2a6d02712f39f (patch)
tree93bd2ebfec80b218b8fd55f144a77a4d27ce8a3d /src/copy.c
parent0d792d061e460fd5dfe6e4226f96bbc3b8788199 (diff)
downloadcoreutils-883ac22239036025896ff99bd4b2a6d02712f39f.tar.xz
cp: make --attributes-only override --reflink completely
* doc/coreutils.texi (cp invocation): Change the description slightly so as users might not immediately discount using this option. Mention that --reflink is overridden by the other linking options and --attributes-only, and give an example where this might be useful. * src/copy.c (copy_internal): Bypass the reflink if --attributes-only is specifed. * tests/cp/reflink-perm: Ensure both --reflink modes are overridden by --attributes-only. * NEWS: Mention the change in behavior. Reported by Jim Meyering.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c
index df31592db..07501dfd4 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -622,7 +622,8 @@ copy_reg (char const *src_name, char const *dst_name,
goto close_src_and_dst_desc;
}
- if (x->reflink_mode)
+ /* --attributes-only overrides --reflink. */
+ if (data_copy_required && x->reflink_mode)
{
bool clone_ok = clone_file (dest_desc, source_desc) == 0;
if (clone_ok || x->reflink_mode == REFLINK_ALWAYS)