[PATCH 1/6] fixup! Add reftable library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Schindelin <johannes.schindelin@xxxxxx>

Close files before trying to unlink them. This is actually required on
Windows.

Note: this is probably not the only part of the code that requires this
type of fix, but it seems to be enough to let the _current_ version of
t0031 pass.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---
 reftable/stack.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/reftable/stack.c b/reftable/stack.c
index e7b625d924a..2e32f7671c2 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -852,6 +852,10 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,
 		}
 	}
 
+	if (lock_file_fd > 0) {
+		close(lock_file_fd);
+		lock_file_fd = 0;
+	}
 	err = unlink(slice_as_string(&lock_file_name));
 	if (err < 0) {
 		goto exit;
-- 
gitgitgadget




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux