Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'mh/lockfile'
[gitweb.git]
/
lockfile.c
diff --git
a/lockfile.c
b/lockfile.c
index d27e61cafcfd2a8277e67edddaf41c29065babee..7bfec4b773bc710b474677b808c4bdacf53af91b 100644
(file)
--- a/
lockfile.c
+++ b/
lockfile.c
@@
-207,9
+207,12
@@
int hold_lock_file_for_append(struct lock_file *lk, const char *path, int flags)
if (flags & LOCK_DIE_ON_ERROR)
exit(128);
+ close(orig_fd);
rollback_lock_file(lk);
errno = save_errno;
return -1;
+ } else {
+ close(orig_fd);
}
return fd;
}