ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
9fc0f6
From 5284c03b3bc881c4b79b1afb32284dd86ab836f5 Mon Sep 17 00:00:00 2001
9fc0f6
From: Lennart Poettering <lennart@poettering.net>
9fc0f6
Date: Wed, 27 Nov 2013 00:58:39 +0100
9fc0f6
Subject: [PATCH] journal: fix iteration when we go backwards from the
9fc0f6
 beginning of an array chain element
9fc0f6
9fc0f6
---
9fc0f6
 src/journal/journal-file.c | 2 +-
9fc0f6
 1 file changed, 1 insertion(+), 1 deletion(-)
9fc0f6
9fc0f6
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
9fc0f6
index 7adb1b5..53dd0c3 100644
9fc0f6
--- a/src/journal/journal-file.c
9fc0f6
+++ b/src/journal/journal-file.c
9fc0f6
@@ -1687,7 +1687,7 @@ found:
9fc0f6
                 return 0;
9fc0f6
 
9fc0f6
         /* Let's cache this item for the next invocation */
9fc0f6
-        chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, i + (subtract_one ? -1 : 0));
9fc0f6
+        chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, subtract_one ? (i > 0 ? i-1 : (uint64_t) -1) : i);
9fc0f6
 
9fc0f6
         if (subtract_one && i == 0)
9fc0f6
                 p = last_p;