diff --git a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c index c517e31cc4..d46d4914d4 100644 --- a/src/libsystemd/sd-journal/journal-file.c +++ b/src/libsystemd/sd-journal/journal-file.c @@ -2256,6 +2256,7 @@ int journal_file_append_entry( EntryItem *items; uint64_t xor_hash = 0; struct dual_timestamp _ts; + sd_id128_t _boot_id; int r; assert(f); @@ -2277,6 +2278,14 @@ int journal_file_append_entry( ts = &_ts; } + if (!boot_id) { + r = sd_id128_get_boot(&_boot_id); + if (r < 0) + return r; + + boot_id = &_boot_id; + } + #if HAVE_GCRYPT r = journal_file_maybe_append_tag(f, ts->realtime); if (r < 0)