]> git.ipfire.org Git - thirdparty/systemd.git/commit
logs-show: flush matches before and after finding boots
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 26 Apr 2024 03:10:39 +0000 (12:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 May 2024 02:43:57 +0000 (11:43 +0900)
commit87dfaba7e9d20d2e94cebc0a3f9fcb807d5473f5
tree539142c9189b2ee7c51842d8cc365611705ecfb5
parentae0e6de918b7f8cb89ed1d69a4631d02eeab7d0c
logs-show: flush matches before and after finding boots

Otherwise, if several matches already set, then the first seek to head
or tail may move the cursor to an invalid place, hence they provide
wrong ID(s). Also, reading journal after calling these function may
provide unexpected data.

Currently, the caller does not install any matches before calling the
functions, and does not read any journal entry after journal_get_boots()
succeeds or journal_find_boot_by_offset() succeeds with 0. Hence, this
should not change any behavior. Just for safety.
src/shared/logs-show.c