config: use chmod() instead of fchmod()
There is no fchmod() on native Windows platforms (MinGW and MSVC), and the equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista. Use chmod() instead. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
daa22c6f8d
commit
2569d23915
8
config.c
8
config.c
@ -1634,8 +1634,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
|
|||||||
MAP_PRIVATE, in_fd, 0);
|
MAP_PRIVATE, in_fd, 0);
|
||||||
close(in_fd);
|
close(in_fd);
|
||||||
|
|
||||||
if (fchmod(fd, st.st_mode & 07777) < 0) {
|
if (chmod(lock->filename, st.st_mode & 07777) < 0) {
|
||||||
error("fchmod on %s failed: %s",
|
error("chmod on %s failed: %s",
|
||||||
lock->filename, strerror(errno));
|
lock->filename, strerror(errno));
|
||||||
ret = CONFIG_NO_WRITE;
|
ret = CONFIG_NO_WRITE;
|
||||||
goto out_free;
|
goto out_free;
|
||||||
@ -1813,8 +1813,8 @@ int git_config_rename_section_in_file(const char *config_filename,
|
|||||||
|
|
||||||
fstat(fileno(config_file), &st);
|
fstat(fileno(config_file), &st);
|
||||||
|
|
||||||
if (fchmod(out_fd, st.st_mode & 07777) < 0) {
|
if (chmod(lock->filename, st.st_mode & 07777) < 0) {
|
||||||
ret = error("fchmod on %s failed: %s",
|
ret = error("chmod on %s failed: %s",
|
||||||
lock->filename, strerror(errno));
|
lock->filename, strerror(errno));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user