]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-journal: also clear saved direction on seek 29235/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Sep 2023 21:36:50 +0000 (06:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Sep 2023 16:59:21 +0000 (01:59 +0900)
commit4aa33df84549d65410330f4228ddaa17c75763d7
tree72833a044c906f27e54d6b4f8ed7828b5ad534de
parent45689fd2655d66f993d462b6e30f709562b51f6d
sd-journal: also clear saved direction on seek

Otherwise, sd_journal_previous() -> real_journal_next(DIRECTION_UP) ->
next_beyond_location() wrongly handles that previously we hit EOF of
the file, and returns 0 without finding a matching entry.

Fixes #29216.
src/journal/test-journal-interleaving.c
src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/journal-file.h