]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
copy.c: improve a comment
authorJim Meyering <meyering@redhat.com>
Sun, 7 Feb 2010 20:02:18 +0000 (21:02 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 7 Feb 2010 20:02:18 +0000 (21:02 +0100)
* src/copy.c (copy_reg): The comment about POSIXLY_CORRECT refers
only to cp, not to any other application that uses copy.c.

src/copy.c

index 80ec3625e11ba99b3239a474494e087282b2908e..8399b71307d745e2e3def3833b0466ab809e2977 100644 (file)
@@ -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;