From 41985f68656250f4fe9b67690ceb17702659bf07 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 14:13:51 -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