summaryrefslogtreecommitdiff
path: root/src/journal/mmap-cache.c
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-10-16 12:03:37 +0100
committerLennart Poettering <lennart@poettering.net>2012-10-16 16:14:46 +0200
commita2ab7ee6122a5006cafc45d7b81f726656fb65cc (patch)
tree013dbd264e4d3a861e1fc4d1d78fa9e518bbe400 /src/journal/mmap-cache.c
parent89de694724f376a6852e879fe987e7e531327654 (diff)
journal: Set the last_unused pointer correctly when attaching an unused window
It seems the previous code was copy/pasted from context_detach_window() but not updated.
Diffstat (limited to 'src/journal/mmap-cache.c')
-rw-r--r--src/journal/mmap-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
index 7813f03754..251aefe121 100644
--- a/src/journal/mmap-cache.c
+++ b/src/journal/mmap-cache.c
@@ -205,8 +205,8 @@ static void context_attach_window(Context *c, Window *w) {
if (w->in_unused) {
/* Used again? */
LIST_REMOVE(Window, unused, c->cache->unused, w);
- if (!c->cache->last_unused)
- c->cache->last_unused = w;
+ if (c->cache->last_unused == w)
+ c->cache->last_unused = w->unused_prev;
w->in_unused = false;
}