summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-25 21:57:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-25 21:57:09 (GMT)
commitdb86e61cbbc4c59a0886366bbf392498e64b53c8 (patch)
tree8b92645b8adeddaf02caa483579c64dbc09370fe /config.c
parent424f89f098a045785471cccb4f7307cc5b05bc54 (diff)
parent9e9033166b3a6b34aad917891b9210fa194fdfd9 (diff)
downloadgit-db86e61cbbc4c59a0886366bbf392498e64b53c8.zip
git-db86e61cbbc4c59a0886366bbf392498e64b53c8.tar.gz
git-db86e61cbbc4c59a0886366bbf392498e64b53c8.tar.bz2
Merge branch 'mh/tempfile'
The "lockfile" API has been rebuilt on top of a new "tempfile" API. * mh/tempfile: credential-cache--daemon: use tempfile module credential-cache--daemon: delete socket from main() gc: use tempfile module to handle gc.pid file lock_repo_for_gc(): compute the path to "gc.pid" only once diff: use tempfile module setup_temporary_shallow(): use tempfile module write_shared_index(): use tempfile module register_tempfile(): new function to handle an existing temporary file tempfile: add several functions for creating temporary files prepare_tempfile_object(): new function, extracted from create_tempfile() tempfile: a new module for handling temporary files commit_lock_file(): use get_locked_file_path() lockfile: add accessor get_lock_file_path() lockfile: add accessors get_lock_file_fd() and get_lock_file_fp() create_bundle(): duplicate file descriptor to avoid closing it twice lockfile: move documentation to lockfile.h and lockfile.c
Diffstat (limited to 'config.c')
-rw-r--r--config.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/config.c b/config.c
index 9fd275f..a34b850 100644
--- a/config.c
+++ b/config.c
@@ -2066,9 +2066,9 @@ int git_config_set_multivar_in_file(const char *config_filename,
}
close(in_fd);
- if (chmod(lock->filename.buf, st.st_mode & 07777) < 0) {
+ if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) {
error("chmod on %s failed: %s",
- lock->filename.buf, strerror(errno));
+ get_lock_file_path(lock), strerror(errno));
ret = CONFIG_NO_WRITE;
goto out_free;
}
@@ -2151,7 +2151,7 @@ out_free:
return ret;
write_err_out:
- ret = write_error(lock->filename.buf);
+ ret = write_error(get_lock_file_path(lock));
goto out_free;
}
@@ -2252,9 +2252,9 @@ int git_config_rename_section_in_file(const char *config_filename,
fstat(fileno(config_file), &st);
- if (chmod(lock->filename.buf, st.st_mode & 07777) < 0) {
+ if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) {
ret = error("chmod on %s failed: %s",
- lock->filename.buf, strerror(errno));
+ get_lock_file_path(lock), strerror(errno));
goto out;
}
@@ -2275,7 +2275,7 @@ int git_config_rename_section_in_file(const char *config_filename,
}
store.baselen = strlen(new_name);
if (!store_write_section(out_fd, new_name)) {
- ret = write_error(lock->filename.buf);
+ ret = write_error(get_lock_file_path(lock));
goto out;
}
/*
@@ -2301,7 +2301,7 @@ int git_config_rename_section_in_file(const char *config_filename,
continue;
length = strlen(output);
if (write_in_full(out_fd, output, length) != length) {
- ret = write_error(lock->filename.buf);
+ ret = write_error(get_lock_file_path(lock));
goto out;
}
}