summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-05 04:34:24 -0500
committerGitHub <noreply@github.com>2021-01-05 04:34:24 -0500
commit1b9366d650200d0f2029d628fa00d1fd318631aa (patch)
treec8d7d8d7381f32651741ca30b06bfc836fc4d8b8 /libpod
parent618c35570de19f1ecdcfb49e87871287205809f2 (diff)
parent002d0d6ee6a4297bbcf2cf1d113536d28f7f75d1 (diff)
downloadpodman-1b9366d650200d0f2029d628fa00d1fd318631aa.tar.gz
podman-1b9366d650200d0f2029d628fa00d1fd318631aa.tar.bz2
podman-1b9366d650200d0f2029d628fa00d1fd318631aa.zip
Merge pull request #8873 from baude/issue8864
close journald when reading
Diffstat (limited to 'libpod')
-rw-r--r--libpod/events/journal_linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libpod/events/journal_linux.go b/libpod/events/journal_linux.go
index 71c638017..8b7e448b1 100644
--- a/libpod/events/journal_linux.go
+++ b/libpod/events/journal_linux.go
@@ -84,7 +84,11 @@ func (e EventJournalD) Read(ctx context.Context, options ReadOptions) error {
if err != nil {
return err
}
-
+ defer func() {
+ if err := j.Close(); err != nil {
+ logrus.Errorf("Unable to close journal :%v", err)
+ }
+ }()
// match only podman journal entries
podmanJournal := sdjournal.Match{Field: "SYSLOG_IDENTIFIER", Value: "podman"}
if err := j.AddMatch(podmanJournal.String()); err != nil {
@@ -112,7 +116,6 @@ func (e EventJournalD) Read(ctx context.Context, options ReadOptions) error {
if err != nil {
return errors.Wrap(err, "failed to get journal cursor")
}
-
for {
select {
case <-ctx.Done():