systemd/0041-journal-fix-iteration-when-we-go-backwards-from-the-.patch

27 lines
969 B
Diff

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