<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - sd_journal_next after sd_journal_seek_tail is broken."
href="https://bugs.freedesktop.org/show_bug.cgi?id=64614">64614</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>sd_journal_next after sd_journal_seek_tail is broken.
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>marius.vollmer@redhat.com
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=79325" name="attach_79325" title="Test program.">attachment 79325</a> <a href="attachment.cgi?id=79325&action=edit" title="Test program.">[details]</a></span>
Test program.
>From the documentation, one might understand that sd_journal_seek_tail move to
the last entry and that a subsequent sd_journal_next would access that entry.
(Because it is worded very much like the docs for sd_journal_seek_head, which
works that way.)
In fact, sd_journal_seek_tail seems to move to just _after_ the last entry, and
one needs to use sd_journal_previous to access it. I think this should be
documented more clearly.
What's worse is that if does call sd_journal_next after sd_journal_seek_tail,
this is successful and will access random entries. Instead, I would expect
sd_journal_next to return 0 (or an error). The attached program demonstrates
this.
I might try to provide some patches (docs and code), but with low priority.</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>