]> err.no Git - systemd/commitdiff
journald: copy metrics/compression state from template when rotating
authorLennart Poettering <lennart@poettering.net>
Thu, 15 Mar 2012 01:58:27 +0000 (02:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 15 Mar 2012 02:01:09 +0000 (03:01 +0100)
src/journal/journal-file.c
src/journal/journald.c

index 7f5d7c27b21d22823f4d4fa937cfb4cd20365cb1..a784a3391b9271cdfc7b612957e9570ec1146ec7 100644 (file)
@@ -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;
index e9ac897de7fd37793f5fa654274ebf5ed65e063b..fb298be758f91058028feb46aa140becfcc6485b 100644 (file)
@@ -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) {