diff options
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index 5d33fb93878..7d2f10d517c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1951,9 +1951,10 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */) owner and group. */ if (input_file_statable_p) { - if (! NILP (preserve_uid_gid)) - fchown (ofd, st.st_uid, st.st_gid); - fchmod (ofd, st.st_mode & 07777); + if (!NILP (preserve_uid_gid) && fchown (ofd, st.st_uid, st.st_gid) != 0) + report_file_error ("Doing chown", Fcons (newname, Qnil)); + if (fchmod (ofd, st.st_mode & 07777) != 0) + report_file_error ("Doing chmod", Fcons (newname, Qnil)); } #endif /* not MSDOS */ |