diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-22 18:01:59 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-22 18:01:59 -0700 |
commit | c9c49752e15c105ded153e9ab0a42743f57184e5 (patch) | |
tree | e395db95d87459082bace9fcf3a2cec0ea3d1aea /src/fileio.c | |
parent | 9d0da923ebd2b78abb6e02f0b90cfe9d818eb301 (diff) | |
parent | b9b4b7cb4c27f9f6ad644168f0e1241e5c0d6eaa (diff) | |
download | emacs-c9c49752e15c105ded153e9ab0a42743f57184e5.tar.gz emacs-c9c49752e15c105ded153e9ab0a42743f57184e5.tar.bz2 emacs-c9c49752e15c105ded153e9ab0a42743f57184e5.zip |
Fix more problems found by GCC 4.5.2's static checks.
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 */ |