Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
config: use chmod() instead of fchmod()
author
Karsten Blees
<karsten.blees@gmail.com>
Tue, 15 Jul 2014 22:54:30 +0000
(
00:54
+0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 16 Jul 2014 20:05:21 +0000
(13:05 -0700)
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>
config.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
daa22c6
)
diff --git
a/config.c
b/config.c
index 62de69e148be7ec3383f2aa606a1a2eaffe601f7..9c01c21ce78382fe1cf3f47712ec593836fda2f1 100644
(file)
--- a/
config.c
+++ b/
config.c
@@
-1634,8
+1634,8
@@
int git_config_set_multivar_in_file(const char *config_filename,
MAP_PRIVATE, in_fd, 0);
close(in_fd);
MAP_PRIVATE, in_fd, 0);
close(in_fd);
- if (
fchmod(fd
, st.st_mode & 07777) < 0) {
- error("
f
chmod 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;
lock->filename, strerror(errno));
ret = CONFIG_NO_WRITE;
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) {
- ret = error("
f
chmod 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;
}
lock->filename, strerror(errno));
goto out;
}