Skip to content

Commit

Permalink
libct: close log pipe
Browse files Browse the repository at this point in the history
Otherwise we have one extra fd opened after container.Run.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Feb 10, 2021
1 parent d6f6606 commit 12f23e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libcontainer/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ type Config struct {
LogPipeFd string
}

func ForwardLogs(logPipe io.Reader) {
func ForwardLogs(logPipe io.ReadCloser) {
defer logPipe.Close()
lineReader := bufio.NewReader(logPipe)
for {
line, err := lineReader.ReadBytes('\n')
Expand Down

0 comments on commit 12f23e6

Please sign in to comment.