From: Jim Meyering Date: Fri, 21 Jun 2002 12:06:17 +0000 (+0000) Subject: Include hurd.h. X-Git-Tag: FILEUTILS-4_1_9~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7313803f0c137a83787ea1166c30f9bf84de1d1;p=thirdparty%2Fcoreutils.git Include hurd.h. (copy_internal): Preserve the stat.st_author field. --- diff --git a/src/copy.c b/src/copy.c index ea83afac7d..8df19ce9e7 100644 --- a/src/copy.c +++ b/src/copy.c @@ -26,6 +26,10 @@ #include #include +#if HAVE_HURD_H +# include +#endif + #include "system.h" #include "error.h" #include "backupfile.h" @@ -1508,6 +1512,16 @@ copy_internal (const char *src_path, const char *dst_path, } } +#if HAVE_STRUCT_STAT_ST_AUTHOR + /* Preserve the st_author field. */ + { + file_t file = getdport (dst_path); + if (file_chauthor (file, src_sb.st_author)) + error (0, errno, _("preserving authorship for %s"), quote (dst_path)); + mach_port_deallocate (mach_task_self (), file); + } +#endif + /* Permissions of newly-created regular files were set upon `open' in copy_reg. But don't return early if there were any special bits and we had to run chown, because the chown must have reset those bits. */