summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-20 16:11:42 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-20 16:11:42 +0200
commit8088cbd3cfcf539c984d8042cd2b92ebbfda6d82 (patch)
tree564b151870105cb540313774907181c1bf85c3b1 /src/journal/journal-file.c
parentf7fab8a5ae7a3b378040203821383f5a8fc91126 (diff)
journal: use a macro to check for file header flags
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r--src/journal/journal-file.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index f419cf6b65..760efaebbb 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -210,8 +210,7 @@ static int journal_file_verify_header(JournalFile *f) {
if (le64toh(f->header->header_size) < HEADER_SIZE_MIN)
return -EBADMSG;
- if ((le32toh(f->header->compatible_flags) & HEADER_COMPATIBLE_SEALED) &&
- !JOURNAL_HEADER_CONTAINS(f->header, n_entry_arrays))
+ if (JOURNAL_HEADER_SEALED(f->header) && !JOURNAL_HEADER_CONTAINS(f->header, n_entry_arrays))
return -EBADMSG;
if ((le64toh(f->header->header_size) + le64toh(f->header->arena_size)) > (uint64_t) f->last_stat.st_size)
@@ -251,10 +250,10 @@ static int journal_file_verify_header(JournalFile *f) {
}
}
- f->compress = !!(le32toh(f->header->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESSED);
+ f->compress = JOURNAL_HEADER_COMPRESSED(f->header);
if (f->writable)
- f->seal = !!(le32toh(f->header->compatible_flags) & HEADER_COMPATIBLE_SEALED);
+ f->seal = JOURNAL_HEADER_SEALED(f->header);
return 0;
}
@@ -1927,10 +1926,10 @@ void journal_file_print_header(JournalFile *f) {
f->header->state == STATE_OFFLINE ? "OFFLINE" :
f->header->state == STATE_ONLINE ? "ONLINE" :
f->header->state == STATE_ARCHIVED ? "ARCHIVED" : "UNKNOWN",
- (f->header->compatible_flags & HEADER_COMPATIBLE_SEALED) ? " SEALED" : "",
- (f->header->compatible_flags & ~HEADER_COMPATIBLE_SEALED) ? " ???" : "",
- (f->header->incompatible_flags & HEADER_INCOMPATIBLE_COMPRESSED) ? " COMPRESSED" : "",
- (f->header->incompatible_flags & ~HEADER_INCOMPATIBLE_COMPRESSED) ? " ???" : "",
+ JOURNAL_HEADER_SEALED(f->header) ? " SEALED" : "",
+ (le32toh(f->header->compatible_flags) & ~HEADER_COMPATIBLE_SEALED) ? " ???" : "",
+ JOURNAL_HEADER_COMPRESSED(f->header) ? " COMPRESSED" : "",
+ (le32toh(f->header->incompatible_flags) & ~HEADER_INCOMPATIBLE_COMPRESSED) ? " ???" : "",
(unsigned long long) le64toh(f->header->header_size),
(unsigned long long) le64toh(f->header->arena_size),
(unsigned long long) le64toh(f->header->data_hash_table_size) / sizeof(HashItem),