]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: fix assignment of tail entry offset
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 May 2023 21:02:00 +0000 (06:02 +0900)
committerLennart Poettering <lennart@poettering.net>
Thu, 1 Jun 2023 15:04:10 +0000 (17:04 +0200)
Fixes a bug introduced by 206f0f397edf1144c63a158fb30f496c3e89f256.

src/libsystemd/sd-journal/journal-file.c

index 78dc93516162342f183f041537ec8c9aecb09aa4..d1f8ca381eb65623688b056dff215d08765583d6 100644 (file)
@@ -2122,7 +2122,8 @@ static int journal_file_link_entry(
 
         f->header->tail_entry_realtime = o->entry.realtime;
         f->header->tail_entry_monotonic = o->entry.monotonic;
-        f->header->tail_entry_offset = offset;
+        if (JOURNAL_HEADER_CONTAINS(f->header, tail_entry_offset))
+                f->header->tail_entry_offset = htole64(offset);
         f->newest_mtime = 0; /* we have a new tail entry now, explicitly invalidate newest boot id/timestamp info */
 
         /* Link up the items */