From: Lennart Poettering Date: Thu, 15 Mar 2012 01:58:27 +0000 (+0100) Subject: journald: copy metrics/compression state from template when rotating X-Git-Tag: v44~17 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15944db87130f9b58565023c46c22bd73b0b71be;p=systemd journald: copy metrics/compression state from template when rotating --- 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) {