chiark / gitweb /
journal: actually set archived files to archived state
authorLennart Poettering <lennart@poettering.net>
Mon, 16 Jul 2012 22:55:02 +0000 (00:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 16 Jul 2012 22:59:03 +0000 (00:59 +0200)
src/journal/journal-file.c

index 180b43a9c53c4f068c83e5fba43d9876ce646f74..d8ce495d86d0146be274bec804d8d4b98082e0b8 100644 (file)
@@ -74,7 +74,8 @@ void journal_file_close(JournalFile *f) {
         assert(f);
 
         if (f->header) {
-                if (f->writable)
+                /* Mark the file offline. Don't override the archived state if it already is set */
+                if (f->writable && f->header->state == STATE_ONLINE)
                         f->header->state = STATE_OFFLINE;
 
                 munmap(f->header, PAGE_ALIGN(sizeof(Header)));