summaryrefslogtreecommitdiff
path: root/src/journal/mmap-cache.c
diff options
context:
space:
mode:
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;
}