summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-16 22:51:28 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-17 00:59:03 +0200
commit71fa6f006f92831c0c02e844b4c35e4b7197c6d6 (patch)
tree5797bb3dc0a4a4579cc0880658ddfdec8bb4aaf7 /src/journal/journal-file.c
parentdca6219e04505e9fa10b32e71059ce2abfae1dad (diff)
journal: immediately rotate when the journal was previously not closed properly
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r--src/journal/journal-file.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 9128f0d642..9d8c9e686d 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -188,13 +188,15 @@ static int journal_file_verify_header(JournalFile *f) {
state = f->header->state;
- if (state == STATE_ONLINE)
- log_debug("Journal file %s is already online. Assuming unclean closing. Ignoring.", f->path);
- /* FIXME: immediately rotate */
- else if (state == STATE_ARCHIVED)
+ if (state == STATE_ONLINE) {
+ log_debug("Journal file %s is already online. Assuming unclean closing.", f->path);
+ return -EBUSY;
+ } else if (state == STATE_ARCHIVED)
return -ESHUTDOWN;
- else if (state != STATE_OFFLINE)
- log_debug("Journal file %s has unknown state %u. Ignoring.", f->path, state);
+ else if (state != STATE_OFFLINE) {
+ log_debug("Journal file %s has unknown state %u.", f->path, state);
+ return -EBUSY;
+ }
}
return 0;