aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-08-10 11:47:39 +0200
committerJunio C Hamano <gitster@pobox.com>2015-08-10 12:57:14 -0700
commitb4fb09e4da53bfc6c720337142af5db3204736d5 (patch)
treeee21234e6668f9a03d08d0713b3a27df4e3d444a /config.c
parentc99a4c2db3053e4fb6a43870f5c747f858b0f58f (diff)
downloadgit-b4fb09e4da53bfc6c720337142af5db3204736d5.tar.gz
git-b4fb09e4da53bfc6c720337142af5db3204736d5.tar.xz
lockfile: add accessor get_lock_file_path()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 ab46462e1..adf8b5303 100644
--- a/config.c
+++ b/config.c
@@ -2056,9 +2056,9 @@ int git_config_set_multivar_in_file(const char *config_filename,
MAP_PRIVATE, in_fd, 0);
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;
}
@@ -2138,7 +2138,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;
}
@@ -2239,9 +2239,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;
}
@@ -2262,7 +2262,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;
}
/*
@@ -2288,7 +2288,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;
}
}