From 65c1a0be48bddba7bfcba13680ade57568fdc559 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 30 Oct 2026 20:52:56 -0700 Subject: Let go of a slot lock that cannot take its key A failed truncate or key write returned with the descriptor still open, so the lock was held while the page rendered uncached and the file was left behind. It is removed before its last close, as every holder does. --- source/cache.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/cache.c') 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; -- cgit 2.12.1