Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lockfile.h')
-rw-r--r--lockfile.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lockfile.h b/lockfile.h
index 572064939c..dd4259bc40 100644
--- a/lockfile.h
+++ b/lockfile.h
@@ -246,7 +246,13 @@ extern char *get_locked_file_path(struct lock_file *lk);
*/
static inline int close_lock_file(struct lock_file *lk)
{
- return close_tempfile(&lk->tempfile);
+ int ret = close_tempfile_gently(&lk->tempfile);
+ if (ret) {
+ int saved_errno = errno;
+ delete_tempfile(&lk->tempfile);
+ errno = saved_errno;
+ }
+ return ret;
}
/*