From 841c4466fdeccb5c5813099f1f5d46b87ba01b13 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 23 Aug 2026 17:50:56 -1000 Subject: Log scan lock failures that are not contention --- source/cgit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/cgit.c') diff --git a/source/cgit.c b/source/cgit.c index 42325a0..37b07d7 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -366,8 +366,13 @@ static int generate_cached_repolist(const char *path, const char *cached_rc) } if (fcntl(fd, F_SETLK, &lock) < 0) { // A lock held elsewhere only means concurrent requests, which - // is not worth a line in the server log. + // is not worth a line in the server log. Any other failure, a + // filesystem without lock support say, silently costs a scan + // on every request and does deserve one. err = errno; + if (err != EACCES && err != EAGAIN) + fprintf(stderr, "[cgit] Error locking %s: %s (%d)\n", + locked_rc.buf, strerror(err), err); close(fd); goto out; } -- cgit v2.8.0