summaryrefslogtreecommitdiff
path: root/src/journal/journald.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-10-14 05:12:58 +0200
committerLennart Poettering <lennart@poettering.net>2011-10-14 05:12:58 +0200
commitc2373f848dddcc1827cf715c5ef778dc8d475761 (patch)
tree9fccfcaa1846b0aba561d4b5a2bfa26611eb6e3c /src/journal/journald.c
parent161e54f8719c4a11440d762276cbccbeb1736f8c (diff)
journal: synchronize seqnum across files
Diffstat (limited to 'src/journal/journald.c')
-rw-r--r--src/journal/journald.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 1143d81abc..ede314a55f 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -43,6 +43,8 @@ typedef struct Server {
JournalFile *runtime_journal;
JournalFile *system_journal;
Hashmap *user_journals;
+
+ uint64_t seqnum;
} Server;
static void fix_perms(JournalFile *f, uid_t uid) {
@@ -118,7 +120,7 @@ static JournalFile* find_journal(Server *s, uid_t uid) {
if (asprintf(&p, "/var/log/journal/%s/user-%lu.journal", sd_id128_to_string(machine, ids), (unsigned long) uid) < 0)
return s->system_journal;
- r = journal_file_open(p, O_RDWR|O_CREAT, 0640, NULL, &f);
+ r = journal_file_open(p, O_RDWR|O_CREAT, 0640, s->system_journal, &f);
free(p);
if (r < 0)
@@ -252,7 +254,7 @@ static void process_message(Server *s, const char *buf, struct ucred *ucred, str
if (!f)
log_warning("Dropping message, as we can't find a place to store the data.");
else {
- r = journal_file_append_entry(f, NULL, iovec, n, NULL, NULL);
+ r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL);
if (r < 0)
log_error("Failed to write entry, ignoring: %s", strerror(-r));