summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-01-02 21:34:53 +0000
committerJim Meyering <jim@meyering.net>2006-01-02 21:34:53 +0000
commit7f8d61f03e3d7abda08aaa8c41d4d4d4d22fb3bb (patch)
tree2ffba4945ed0ab21d0de10f827d6e56d0ee246ba /src
parent8298ae989a426d958e48ad06de4831380e2a3058 (diff)
downloadcoreutils-7f8d61f03e3d7abda08aaa8c41d4d4d4d22fb3bb.tar.xz
(set_owner): Correct a comment.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c
index ed57f4403..ba8c4e189 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -176,7 +176,8 @@ copy_dir (char const *src_name_in, char const *dst_name_in, bool new_dst,
st_gid fields of SRC_SB. If DEST_DESC is undefined (-1), set
the owner and owning group of DST_NAME instead. DEST_DESC must
refer to the same file as DEST_NAME if defined.
- Return true if successful. */
+ Return true if the syscall succeeds, or if it's ok not to
+ preserve ownership. */
static bool
set_owner (const struct cp_options *x, char const *dst_name, int dest_desc,
@@ -192,6 +193,7 @@ set_owner (const struct cp_options *x, char const *dst_name, int dest_desc,
if (chown (dst_name, uid, gid) == 0)
return true;
}
+
if (! chown_failure_ok (x))
{
error (0, errno, _("failed to preserve ownership for %s"),
@@ -199,6 +201,7 @@ set_owner (const struct cp_options *x, char const *dst_name, int dest_desc,
if (x->require_preserve)
return false;
}
+
return true;
}