summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-02-07 21:02:18 +0100
committerJim Meyering <meyering@redhat.com>2010-02-07 21:02:18 +0100
commited509250a2c9436ba1f2fd013b0f192abd3906f2 (patch)
tree86822860ad33729045033ce8b91bf7da8399a65a
parent543696a9af2d25bec0708b6b790102c01910b5ff (diff)
downloadcoreutils-ed509250a2c9436ba1f2fd013b0f192abd3906f2.tar.xz
copy.c: improve a comment
* src/copy.c (copy_reg): The comment about POSIXLY_CORRECT refers only to cp, not to any other application that uses copy.c.
-rw-r--r--src/copy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/copy.c b/src/copy.c
index 80ec3625e..8399b7130 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -587,10 +587,11 @@ copy_reg (char const *src_name, char const *dst_name,
lstat'ing the DST_NAME shows that it is a symlink, then we
have a problem: trying to resolve this dangling symlink to
a directory/destination-entry pair is fundamentally racy,
- so punt. If POSIXLY_CORRECT is set, simply call open again,
- but without O_EXCL (potentially dangerous). If not, fail
- with a diagnostic. These shenanigans are necessary only
- when copying, i.e., not in move_mode. */
+ so punt. If x->open_dangling_dest_symlink is set (cp sets
+ that when POSIXLY_CORRECT is set in the environment), simply
+ call open again, but without O_EXCL (potentially dangerous).
+ If not, fail with a diagnostic. These shenanigans are necessary
+ only when copying, i.e., not in move_mode. */
if (dest_desc < 0 && dest_errno == EEXIST && ! x->move_mode)
{
struct stat dangling_link_sb;