summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-21 18:18:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-21 18:18:54 (GMT)
commitfb0166c674efbc940ac14453129ab81823badf3d (patch)
treef141fcf947e3190ca7139bd0e4ad23a13add2cbb /config.c
parent80e85754e08da9999f7b7ab956465150aebcf44d (diff)
parent2569d23915471f1727e5945c513b8be299eefa0c (diff)
downloadgit-fb0166c674efbc940ac14453129ab81823badf3d.zip
git-fb0166c674efbc940ac14453129ab81823badf3d.tar.gz
git-fb0166c674efbc940ac14453129ab81823badf3d.tar.bz2
Merge branch 'kb/avoid-fchmod-for-now'
Replaces the only two uses of fchmod() with chmod() because the former does not work on Windows port and because luckily we can. * kb/avoid-fchmod-for-now: config: use chmod() instead of fchmod()
Diffstat (limited to 'config.c')
-rw-r--r--config.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/config.c b/config.c
index ba882a1..9767c4b 100644
--- a/config.c
+++ b/config.c
@@ -1636,8 +1636,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
MAP_PRIVATE, in_fd, 0);
close(in_fd);
- if (fchmod(fd, st.st_mode & 07777) < 0) {
- error("fchmod on %s failed: %s",
+ if (chmod(lock->filename, st.st_mode & 07777) < 0) {
+ error("chmod on %s failed: %s",
lock->filename, strerror(errno));
ret = CONFIG_NO_WRITE;
goto out_free;
@@ -1815,8 +1815,8 @@ int git_config_rename_section_in_file(const char *config_filename,
fstat(fileno(config_file), &st);
- if (fchmod(out_fd, st.st_mode & 07777) < 0) {
- ret = error("fchmod on %s failed: %s",
+ if (chmod(lock->filename, st.st_mode & 07777) < 0) {
+ ret = error("chmod on %s failed: %s",
lock->filename, strerror(errno));
goto out;
}