Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call sd_journal_get_fd() earlier, only if needed
1. The journald client library initializes inotify watch(es) during the first call to sd_journal_get_fd(), and it make sense to open it earlier in order to not lose any journal file rotation events. 2. It only makes sense to call this if we're going to use it later on -- so add a check for config.Follow. 3. Remove the redundant call to sd_journal_get_fd(). NOTE that any subsequent calls to sd_journal_get_fd() return the same file descriptor, so there's no real need to save it for later use in wait_for_data_cancelable(). Based on earlier patch by Nalin Dahyabhai <nalin@redhat.com>. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit 981c016) Signed-off-by: Robert Günzler <robertg@balena.io>
- Loading branch information