Merge pull request #43841 from thaJeztah/22.06_backport_journald_fix_break

[22.06 backport] logger/journald: fix SA4011: ineffective break statement
This commit is contained in:
Tianon Gravi 2022-07-20 10:13:42 -07:00 committed by GitHub
commit a60b458179
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,6 +227,7 @@ func (s *journald) followJournal(logWatcher *logger.LogWatcher, j *C.sd_journal,
waitTimeout := C.uint64_t(250000) // 0.25s
LOOP:
for {
status := C.sd_journal_wait(j, waitTimeout)
if status < 0 {
@ -235,7 +236,7 @@ func (s *journald) followJournal(logWatcher *logger.LogWatcher, j *C.sd_journal,
}
select {
case <-logWatcher.WatchConsumerGone():
break // won't be able to write anything anymore
break LOOP // won't be able to write anything anymore
case <-s.closed:
// container is gone, drain journal
default: