]> git.eshelyaron.com Git - emacs.git/commitdiff
* fileio.c (Fcopy_file): Report error if fchown or fchmod fail.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Mar 2011 02:40:27 +0000 (19:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Mar 2011 02:40:27 +0000 (19:40 -0700)
src/ChangeLog
src/fileio.c

index c97331a78e580ad0af95b4c9de779174d342f138..fdf5715229466da923f3990fcbde025e3711fb3d 100644 (file)
@@ -1,3 +1,7 @@
+2011-03-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fileio.c (Fcopy_file): Report error if fchown or fchmod fail.
+
 2011-03-20  Paul Eggert  <eggert@cs.ucla.edu>
 
        * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
index 5d33fb93878e0a66c158b67c8770f298d1a5df4a..7d2f10d517c66b18b228d2b543d18490642d4042 100644 (file)
@@ -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 */