diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-09-19 23:36:50 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-09-20 18:59:21 +0200 |
commit | 4aa33df84549d65410330f4228ddaa17c75763d7 (patch) | |
tree | 72833a044c906f27e54d6b4f8ed7828b5ad534de /src/libsystemd/sd-journal/journal-file.h | |
parent | test: add more testcases for seeking journal entries (diff) | |
download | systemd-4aa33df84549d65410330f4228ddaa17c75763d7.tar.xz systemd-4aa33df84549d65410330f4228ddaa17c75763d7.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/libsystemd/sd-journal/journal-file.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd/sd-journal/journal-file.h b/src/libsystemd/sd-journal/journal-file.h index a4d8912aa8..b018fd8788 100644 --- a/src/libsystemd/sd-journal/journal-file.h +++ b/src/libsystemd/sd-journal/journal-file.h @@ -31,7 +31,8 @@ typedef struct JournalMetrics { typedef enum direction { DIRECTION_UP, - DIRECTION_DOWN + DIRECTION_DOWN, + _DIRECTION_INVALID = -EINVAL, } direction_t; typedef enum LocationType { |