Diff options
Diffstat (limited to '')
-rw-r--r--source/cache.c3
1 file changed, 3 insertions, 0 deletions
diff --git a/source/cache.c b/source/cache.c
index 64b7148..004a84d 100644
--- a/source/cache.c
+++ b/source/cache.c
@@ -250,6 +250,9 @@ static int lock_slot(struct cache_slot *slot)
) {
err = errno;
fprintf(stderr, "[cgit] Unable to write %s: %s (%d)\n", slot->lock_path, strerror(err), err);
+ unlink(slot->lock_path);
+ close(slot->lock_fd);
+ slot->lock_fd = -1;
return err;
}
return 0;