]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Rename copy_file to copy_file_preserving.
authorBruno Haible <bruno@clisp.org>
Fri, 28 Mar 2003 21:50:08 +0000 (21:50 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:17 +0000 (12:10 +0200)
gettext-tools/lib/ChangeLog
gettext-tools/lib/copy-file.c
gettext-tools/lib/copy-file.h
gettext-tools/src/ChangeLog
gettext-tools/src/msgmerge.c

index 3ada6c0fba01c1798aafb1a0808b1d358b89e7d9..3bfcd20a0c64d7cc1c05180367f7a4e3f045c351 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-28  Bruno Haible  <bruno@clisp.org>
+
+       * copy-file.h (copy_file_preserving): Renamed from copy_file.
+       * copy-file.c (copy_file_preserving): Renamed from copy_file.
+       Preserve the owner and group as well.
+
 2003-02-28  Bruno Haible  <bruno@clisp.org>
 
        Support for relocatable installation.
index 84b07ac8623f3f3e855d9519414491b9541b25bf..a03047b58ead3e87c2f9a9d023678771e04468e3 100644 (file)
@@ -50,7 +50,7 @@
 #define _(str) gettext (str)
 
 void
-copy_file (const char *src_filename, const char *dest_filename)
+copy_file_preserving (const char *src_filename, const char *dest_filename)
 {
   int src_fd;
   struct stat statbuf;
@@ -108,6 +108,9 @@ copy_file (const char *src_filename, const char *dest_filename)
   }
 #endif
 
+  /* Preserve the owner and group.  */
+  chown (dest_filename, statbuf.st_uid, statbuf.st_gid);
+
   /* Preserve the access permissions.  */
   chmod (dest_filename, mode);
 }
index 1608ab70cc7fc2a5accfa466e8dae8c8d9718455..3efda34b875c63e308199f0c1b10f4ff2b0478ff 100644 (file)
@@ -1,5 +1,5 @@
 /* Copying of files.
-   Copyright (C) 2001-2002 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -18,5 +18,7 @@
 
 /* Copy a regular file: from src_filename to dest_filename.
    The destination file is assumed to be a backup file.
+   Modification times, owner, group and access permissions are preserved as
+   far as possible.
    Exit upon failure.  */
-extern void copy_file (const char *src_filename, const char *dest_filename);
+extern void copy_file_preserving (const char *src_filename, const char *dest_filename);
index 35ee8759d1a0ec3744a335b884aab234e703988f..b5e6084f8237108eca7002925c4de9db16dd56de 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-28  Bruno Haible  <bruno@clisp.org>
+
+       * msgmerge.c (main): Use copy_file_preserving instead of copy_file.
+
 2003-03-16  Bruno Haible  <bruno@clisp.org>
 
        * str-list.h (string_list_join): Comment out.
index b134a5b70230d7a4cec71eb42554457e781628e3..347704423ec4251f35b9c1b53e6bdfbb290e15b1 100644 (file)
@@ -361,7 +361,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
          if (backup_type != none)
            {
              backup_file = find_backup_file_name (output_file, backup_type);
-             copy_file (output_file, backup_file);
+             copy_file_preserving (output_file, backup_file);
            }
 
          /* Write the merged message list out.  */