From 15944db87130f9b58565023c46c22bd73b0b71be Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 15 Mar 2012 02:58:27 +0100 Subject: [PATCH] journald: copy metrics/compression state from template when rotating --- src/journal/journal-file.c | 5 +++++ src/journal/journald.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 7f5d7c27..a784a339 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -1740,6 +1740,11 @@ int journal_file_open( f->writable = (flags & O_ACCMODE) != O_RDONLY; f->prot = prot_from_flags(flags); + if (template) { + f->metrics = template->metrics; + f->compress = template->compress; + } + f->path = strdup(fname); if (!f->path) { r = -ENOMEM; diff --git a/src/journal/journald.c b/src/journal/journald.c index e9ac897d..fb298be7 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -308,8 +308,6 @@ static JournalFile* find_journal(Server *s, uid_t uid) { return s->system_journal; server_fix_perms(s, f, uid); - f->metrics = s->system_metrics; - f->compress = s->compress; r = hashmap_put(s->user_journals, UINT32_TO_PTR(uid), f); if (r < 0) { -- 2.39.5