From d7313803f0c137a83787ea1166c30f9bf84de1d1 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 21 Jun 2002 12:06:17 +0000 Subject: Include hurd.h. (copy_internal): Preserve the stat.st_author field. --- src/copy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/copy.c b/src/copy.c index ea83afac7..8df19ce9e 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. */ -- cgit v1.2.3-54-g00ecf