os_fchown: impl and remove HAVE_FCHOWN

This commit is contained in:
Pavel Platto
2014-07-14 00:04:59 +03:00
parent 563f38c317
commit 94f3d30306
6 changed files with 22 additions and 26 deletions

View File

@@ -1119,10 +1119,7 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
if (os_get_file_info((char *)buf->b_ffname, &file_info_old)
&& os_get_file_info((char *)file_name, &file_info_new)
&& file_info_old.stat.st_gid != file_info_new.stat.st_gid
# ifdef HAVE_FCHOWN /* sequent-ptx lacks fchown() */
&& fchown(fd, (uid_t)-1, file_info_old.stat.st_gid) != 0
# endif
) {
&& os_fchown(fd, (uid_t)-1, file_info_old.stat.st_gid) != 0) {
os_setperm(file_name, (perm & 0707) | ((perm & 07) << 3));
}
# ifdef HAVE_SELINUX