]> git.cameronkatri.com Git - cgit.git/blobdiff - cache.c
Don't truncate valid cachefiles
[cgit.git] / cache.c
diff --git a/cache.c b/cache.c
index 2e1ef8cc9e0fe7742965a1b3e845f12fa1fab13f..b947a34e8046b9a5169700cd1205356aac2d4fa7 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -99,6 +99,11 @@ int cache_unlock(struct cacheitem *item)
        return (rename(fmt("%s.lock", item->name), item->name) == 0);
 }
 
+int cache_cancel_lock(struct cacheitem *item)
+{
+       return (unlink(fmt("%s.lock", item->name)) == 0);
+}
+
 int cache_expired(struct cacheitem *item)
 {
        if (item->ttl < 0)