Skip to content
Commit 89a80440 authored by Michal Sekletar's avatar Michal Sekletar Committed by Zbigniew Jędrzejewski-Szmek
Browse files

sd-journal: return SD_JOURNAL_INVALIDATE only if journal files were actually deleted/moved (#5580)

When caller invokes sd_journal_open() we usually open at least one
directory with journal files. add_root_directory() function increments
current_invalidate_counter. After sd_journal_open() returns
current_invalidate_counter != last_invalidate_counter.

After caller waits for journal events (e.g. waits for new messages in
journal) then it usually calls sd_journal_process(). However, on first
call to sd_journal_process(), function determine_change() returns
SD_JOURNAL_INVALIDATE even though no journal files were
deleted/moved. This is because current_invalidate_counter !=
last_invalidate_counter.

After the fix we make sure counters has the same value before we begin
processing inotify events.
(cherry picked from commit f9346444)
parent b8a7de02
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment