From d1afbcd22170e95c79261340071d376fe41fc3af Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 24 Oct 2015 13:17:54 +0200 Subject: journal: fix error handling when compressing journal objects Let's make sure we handle compression errors properly, and don't misunderstand an error for success. Also, let's actually compress things if lz4 is enabled. Fixes #1662. --- src/journal/journal-file.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/journal/journal-file.h') diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index f2c07356c8..898d12d992 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -235,3 +235,8 @@ bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec); int journal_file_map_data_hash_table(JournalFile *f); int journal_file_map_field_hash_table(JournalFile *f); + +static inline bool JOURNAL_FILE_COMPRESS(JournalFile *f) { + assert(f); + return f->compress_xz || f->compress_lz4; +} -- cgit v1.2.3-54-g00ecf