chiark / gitweb /
journal: Set the last_unused pointer correctly when attaching an unused window
authorColin Guthrie <colin@mageia.org>
Tue, 16 Oct 2012 11:03:37 +0000 (12:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 16 Oct 2012 14:14:46 +0000 (16:14 +0200)
It seems the previous code was copy/pasted from context_detach_window()
but not updated.

src/journal/mmap-cache.c

index 7813f03..251aefe 100644 (file)
@@ -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;
         }