Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
revision.c: propagate tag names from pending array
[gitweb.git]
/
lockfile.c
diff --git
a/lockfile.c
b/lockfile.c
index 2a800cef33ed7fb1ba7d3499459eccd824ab33e4..d34a96df4f859feeaa7597abba374128ff9dc598 100644
(file)
--- a/
lockfile.c
+++ b/
lockfile.c
@@
-224,8
+224,11
@@
int hold_lock_file_for_append(struct lock_file *lk, const char *path, int flags)
} else if (copy_fd(orig_fd, fd)) {
if (flags & LOCK_DIE_ON_ERROR)
exit(128);
+ close(orig_fd);
close(fd);
return -1;
+ } else {
+ close(orig_fd);
}
return fd;
}