assert_ret(sd_journal_open_directory(&j, t, 0));
assert_ret(sd_journal_seek_tail(j));
assert_se(sd_journal_previous(j) == 1); /* pointing to the last entry */
- // FIXME: the below does not work. See issue #29216.
- //assert_ret(sd_journal_seek_tail(j));
- //assert_se(sd_journal_previous(j) == 1); /* pointing to the last entry */
+ assert_ret(sd_journal_seek_tail(j));
+ assert_se(sd_journal_previous(j) == 1); /* pointing to the last entry */
test_check_numbers_up(j, 9);
sd_journal_close(j);
f->current_monotonic = 0;
zero(f->current_boot_id);
f->current_xor_hash = 0;
+
+ /* Also reset the previous reading direction. Otherwise, next_beyond_location() may wrongly handle we
+ * already hit EOF. See issue #29216. */
+ f->last_direction = _DIRECTION_INVALID;
}
void journal_file_save_location(JournalFile *f, Object *o, uint64_t offset) {
MAX(MIN_COMPRESS_THRESHOLD, compress_threshold_bytes),
.strict_order = FLAGS_SET(file_flags, JOURNAL_STRICT_ORDER),
.newest_boot_id_prioq_idx = PRIOQ_IDX_NULL,
+ .last_direction = _DIRECTION_INVALID,
};
if (fname) {