diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-03-24 14:04:40 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-03-25 09:59:09 +0100 |
commit | 49615dbd8191e2b898496c5a90fdb35f92d4fdb9 (patch) | |
tree | 38d63d34e959aee2896594dadfb121033aea4cbd /src/journal-remote/journal-remote-write.c | |
parent | a35420d85d42bc1c0c7b315ab161ff0e5026c46d (diff) | |
download | systemd-49615dbd8191e2b898496c5a90fdb35f92d4fdb9.tar.gz |
journal-file: merge compress/seal bool args into a single flags param
Just some modernization/refactoring.
No change in behaviour, just let's do how we do things these days: use
flags param instead of list of bools.
Diffstat (limited to 'src/journal-remote/journal-remote-write.c')
-rw-r--r-- | src/journal-remote/journal-remote-write.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c index 6477bfac2d..f4f3b64811 100644 --- a/src/journal-remote/journal-remote-write.c +++ b/src/journal-remote/journal-remote-write.c @@ -3,8 +3,10 @@ #include "alloc-util.h" #include "journal-remote.h" -static int do_rotate(ManagedJournalFile **f, MMapCache *m, bool compress, bool seal) { - int r = managed_journal_file_rotate(f, m, compress, UINT64_MAX, seal, NULL); +static int do_rotate(ManagedJournalFile **f, MMapCache *m, JournalFileFlags file_flags) { + int r; + + r = managed_journal_file_rotate(f, m, file_flags, UINT64_MAX, NULL); if (r < 0) { if (*f) log_error_errno(r, "Failed to rotate %s: %m", (*f)->file->path); @@ -60,8 +62,7 @@ int writer_write(Writer *w, const struct iovec_wrapper *iovw, const dual_timestamp *ts, const sd_id128_t *boot_id, - bool compress, - bool seal) { + JournalFileFlags file_flags) { int r; assert(w); @@ -71,7 +72,7 @@ int writer_write(Writer *w, if (journal_file_rotate_suggested(w->journal->file, 0, LOG_DEBUG)) { log_info("%s: Journal header limits reached or header out-of-date, rotating", w->journal->file->path); - r = do_rotate(&w->journal, w->mmap, compress, seal); + r = do_rotate(&w->journal, w->mmap, file_flags); if (r < 0) return r; } @@ -87,7 +88,7 @@ int writer_write(Writer *w, return r; log_debug_errno(r, "%s: Write failed, rotating: %m", w->journal->file->path); - r = do_rotate(&w->journal, w->mmap, compress, seal); + r = do_rotate(&w->journal, w->mmap, file_flags); if (r < 0) return r; else |