[systemd-bugs] [Bug 63672] journalctl skips first entry after reboot in certain scenario

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 18 04:18:57 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=63672

--- Comment #1 from Marius Vollmer <marius.vollmer at redhat.com> ---
Here is a patch that fixes this for me:

diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 064929b..15239b5 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -109,6 +109,9 @@ static void set_location(sd_journal *j, LocationType type,
JournalFile *f, Objec

         init_location(&j->current_location, type, f, o);

+        if (j->current_file)
+                j->current_file->current_offset = 0;
+
         j->current_file = f;
         j->current_field = 0;

The theory is the following:  When sd_journal_prev goes from entry e_a in file
f_a to entry e_b in file f_b, then f_a->current_offset will still point to e_a.
 When a subsequent sd_journal_next then goes in the other direction and
switches from file f_b to f_a, it will advance beyond the current position in
f_a, and thereby skip e_a.

Of course, that's just my theory.  Please check this carefully.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130418/7726730b/attachment.html>


More information about the systemd-bugs mailing list