[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/fileio.c
From: |
Richard M . Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/src/fileio.c |
Date: |
Thu, 23 Jun 2005 17:29:32 -0400 |
Index: emacs/src/fileio.c
diff -c emacs/src/fileio.c:1.544 emacs/src/fileio.c:1.545
*** emacs/src/fileio.c:1.544 Tue May 31 21:54:43 2005
--- emacs/src/fileio.c Thu Jun 23 21:29:26 2005
***************
*** 2775,2780 ****
--- 2775,2781 ----
{
if (errno == EXDEV)
{
+ struct stat data;
#ifdef S_IFLNK
symlink_target = Ffile_symlink_p (file);
if (! NILP (symlink_target))
***************
*** 2787,2792 ****
--- 2788,2798 ----
so don't have copy-file prompt again. */
NILP (ok_if_already_exists) ? Qnil : Qt,
Qt, Qnil);
+
+ /* Preserve owner and group, if possible (if we are root). */
+ if (stat (SDATA (encoded_file), &data) >= 0)
+ chown (SDATA (encoded_file), data.st_uid, data.st_gid);
+
Fdelete_file (file);
}
else
- [Emacs-diffs] Changes to emacs/src/fileio.c,
Richard M . Stallman <=