diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-07-21 20:31:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-07-21 20:31:07 +0200 |
commit | ce69e82711b0f965a6a40aae955749bf4ac363b7 (patch) | |
tree | e3e337c2bbd7b257a88020d1f2821f24678f5be4 | |
parent | b65905262bc250810b4b3b5fedc4302c6cc4c9d2 (diff) | |
download | vim-ce69e82711b0f965a6a40aae955749bf4ac363b7.zip |
Fix build problem when fchown() not available. (Gary Johnson)
-rw-r--r-- | src/undo.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/undo.c b/src/undo.c index 5ebf0e7b1..77f57bcaf 100644 --- a/src/undo.c +++ b/src/undo.c @@ -1437,10 +1437,11 @@ u_write_undo(name, forceit, buf, hash) * this fails, set the protection bits for the group same as the * protection bits for others. */ - if (st_old_valid && (mch_stat((char *)file_name, &st_new) >= 0 - && st_new.st_gid != st_old.st_gid + if (st_old_valid + && mch_stat((char *)file_name, &st_new) >= 0 + && st_new.st_gid != st_old.st_gid # ifdef HAVE_FCHOWN /* sequent-ptx lacks fchown() */ - && fchown(fd, (uid_t)-1, st_old.st_gid) != 0) + && fchown(fd, (uid_t)-1, st_old.st_gid) != 0 # endif ) mch_setperm(file_name, (perm & 0707) | ((perm & 07) << 3)); |