]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD/DEBUG: lru: update the standalone code to support the revision
authorWilly Tarreau <w@1wt.eu>
Wed, 26 Jan 2022 10:03:59 +0000 (11:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 27 Jan 2022 15:28:10 +0000 (16:28 +0100)
The standalone testing code didn't implement the revision and didn't
build anymore, let's fix that.

src/lru.c

index 22f15f7041aed115d7cab803f4a978aef1551dcf..d58b188861307fede53e1df58d5b5c7bc036ec62 100644 (file)
--- a/src/lru.c
+++ b/src/lru.c
@@ -247,7 +247,7 @@ static unsigned long long sum(unsigned long long x)
 
 static long get_value(struct lru64_head *lru, long a)
 {
-       struct lru64 *item;
+       struct lru64 *item = NULL;
 
        if (lru) {
                item = lru64_get(a, lru, lru, 0);
@@ -258,7 +258,7 @@ static long get_value(struct lru64_head *lru, long a)
        /* do the painful work here */
        a = sum(a);
        if (item)
-               lru64_commit(item, (void *)a, lru, 0);
+               lru64_commit(item, (void *)a, lru, 1, 0);
        return a;
 }