From baee58e4ef930ec3380807c2245e64432b21d9d2 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 7 Feb 2018 10:35:26 -0500 Subject: [PATCH] Small journal cleanup Clean up a deferred function call in the journal reading logic. Signed-off-by: Nalin Dahyabhai (cherry picked from commit 1ada3e85bf89201910c28f2ff6892c00cee0f137) Signed-off-by: Kir Kolyshkin Upstream-commit: e700930ca521d0c004b6a3ed8bdd35a2d538aa15 Component: engine --- components/engine/daemon/logger/journald/read.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/engine/daemon/logger/journald/read.go b/components/engine/daemon/logger/journald/read.go index 4bddfd5781..981fabc9d8 100644 --- a/components/engine/daemon/logger/journald/read.go +++ b/components/engine/daemon/logger/journald/read.go @@ -330,12 +330,12 @@ func (s *journald) readLogs(logWatcher *logger.LogWatcher, config logger.ReadCon // here, potentially while the goroutine that uses them is still // running. Otherwise, close them when we return from this function. following := false - defer func(pfollowing *bool) { - if !*pfollowing { + defer func() { + if !following { close(logWatcher.Msg) } C.sd_journal_close(j) - }(&following) + }() // Remove limits on the size of data items that we'll retrieve. rc = C.sd_journal_set_data_threshold(j, C.size_t(0)) if rc != 0 {