summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-07-29 17:13:28 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-07-29 17:13:28 +0000
commit528fe6e50441461271655ed8adf933c65597ee3c (patch)
tree693d56d5d0b1036f71e83d4727c56e06cf8e3891 /src
parentaa24517b5f810c7d2c913a22c0c9714983af8116 (diff)
downloadcoreutils-528fe6e50441461271655ed8adf933c65597ee3c.tar.xz
(set_author): Preserve the st_author field via the
file descriptor dest_desc.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index ac54e48a1..3bd29e285 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -213,10 +213,11 @@ set_owner (const struct cp_options *x, char const *dst_name, int dest_desc,
static void
set_author (const char *dst_name, int dest_desc, const struct stat *src_sb)
{
- /* FIXME: Preserve the st_author field via the file descriptor dest_desc. */
#if HAVE_STRUCT_STAT_ST_AUTHOR
/* Preserve the st_author field. */
- file_t file = file_name_lookup (dst_name, 0, 0);
+ file_t file = (dest_desc < 0
+ ? file_name_lookup (dst_name, 0, 0)
+ : getdport (dest_desc));
if (file == MACH_PORT_NULL)
error (0, errno, _("failed to lookup file %s"), quote (dst_name));
else