Mercurial > vim
comparison src/undo.c @ 2367:76b7ba68a098 vim73
Fix build problem when fchown() not available. (Gary Johnson)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 21 Jul 2010 20:31:07 +0200 |
parents | 8878a9f8db87 |
children | 85b7dc8da5eb |
comparison
equal
deleted
inserted
replaced
2366:7a57fe6a5157 | 2367:76b7ba68a098 |
---|---|
1435 /* | 1435 /* |
1436 * Try to set the group of the undo file same as the original file. If | 1436 * Try to set the group of the undo file same as the original file. If |
1437 * this fails, set the protection bits for the group same as the | 1437 * this fails, set the protection bits for the group same as the |
1438 * protection bits for others. | 1438 * protection bits for others. |
1439 */ | 1439 */ |
1440 if (st_old_valid && (mch_stat((char *)file_name, &st_new) >= 0 | 1440 if (st_old_valid |
1441 && st_new.st_gid != st_old.st_gid | 1441 && mch_stat((char *)file_name, &st_new) >= 0 |
1442 && st_new.st_gid != st_old.st_gid | |
1442 # ifdef HAVE_FCHOWN /* sequent-ptx lacks fchown() */ | 1443 # ifdef HAVE_FCHOWN /* sequent-ptx lacks fchown() */ |
1443 && fchown(fd, (uid_t)-1, st_old.st_gid) != 0) | 1444 && fchown(fd, (uid_t)-1, st_old.st_gid) != 0 |
1444 # endif | 1445 # endif |
1445 ) | 1446 ) |
1446 mch_setperm(file_name, (perm & 0707) | ((perm & 07) << 3)); | 1447 mch_setperm(file_name, (perm & 0707) | ((perm & 07) << 3)); |
1447 # ifdef HAVE_SELINUX | 1448 # ifdef HAVE_SELINUX |
1448 if (buf->b_ffname != NULL) | 1449 if (buf->b_ffname != NULL) |