diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index 537b7f4d10d..6bdc030bc6c 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2775,6 +2775,7 @@ This is what happens in interactive use with M-x. */) | |||
| 2775 | { | 2775 | { |
| 2776 | if (errno == EXDEV) | 2776 | if (errno == EXDEV) |
| 2777 | { | 2777 | { |
| 2778 | struct stat data; | ||
| 2778 | #ifdef S_IFLNK | 2779 | #ifdef S_IFLNK |
| 2779 | symlink_target = Ffile_symlink_p (file); | 2780 | symlink_target = Ffile_symlink_p (file); |
| 2780 | if (! NILP (symlink_target)) | 2781 | if (! NILP (symlink_target)) |
| @@ -2787,6 +2788,11 @@ This is what happens in interactive use with M-x. */) | |||
| 2787 | so don't have copy-file prompt again. */ | 2788 | so don't have copy-file prompt again. */ |
| 2788 | NILP (ok_if_already_exists) ? Qnil : Qt, | 2789 | NILP (ok_if_already_exists) ? Qnil : Qt, |
| 2789 | Qt, Qnil); | 2790 | Qt, Qnil); |
| 2791 | |||
| 2792 | /* Preserve owner and group, if possible (if we are root). */ | ||
| 2793 | if (stat (SDATA (encoded_file), &data) >= 0) | ||
| 2794 | chown (SDATA (encoded_file), data.st_uid, data.st_gid); | ||
| 2795 | |||
| 2790 | Fdelete_file (file); | 2796 | Fdelete_file (file); |
| 2791 | } | 2797 | } |
| 2792 | else | 2798 | else |