<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - journalctl skips first entry after reboot in certain scenario"
href="https://bugs.freedesktop.org/show_bug.cgi?id=63672#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - journalctl skips first entry after reboot in certain scenario"
href="https://bugs.freedesktop.org/show_bug.cgi?id=63672">bug 63672</a>
from <span class="vcard"><a class="email" href="mailto:marius.vollmer@redhat.com" title="Marius Vollmer <marius.vollmer@redhat.com>"> <span class="fn">Marius Vollmer</span></a>
</span></b>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>