1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

journald: close sd_journal context after flushing to /var

This commit is contained in:
Lennart Poettering 2012-09-28 15:41:20 +02:00
parent 1845fdd967
commit 80d1c5988b

View File

@ -896,10 +896,9 @@ static int system_journal_open(Server *s) {
}
static int server_flush_to_var(Server *s) {
Object *o = NULL;
int r;
sd_id128_t machine;
sd_journal *j;
sd_journal *j = NULL;
assert(s);
@ -930,6 +929,7 @@ static int server_flush_to_var(Server *s) {
}
SD_JOURNAL_FOREACH(j) {
Object *o = NULL;
JournalFile *f;
f = j->current_file;
@ -967,6 +967,9 @@ finish:
if (r >= 0)
rm_rf("/run/log/journal", false, true, false);
if (j)
sd_journal_close(j);
return r;
}