summaryrefslogtreecommitdiff
path: root/libpod/container_attach_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-11 01:22:30 +0200
committerGitHub <noreply@github.com>2019-07-11 01:22:30 +0200
commite2e8477f83f717d6a92badd317ae909cf185d04e (patch)
tree266259131bc70764b737cc65579641bd8140c533 /libpod/container_attach_linux.go
parentdf3f5afad13c91a6f2be9e83ae328483e047c13c (diff)
parente053e0e05ecd884067125627f0006d1b6e19226e (diff)
downloadpodman-e2e8477f83f717d6a92badd317ae909cf185d04e.tar.gz
podman-e2e8477f83f717d6a92badd317ae909cf185d04e.tar.bz2
podman-e2e8477f83f717d6a92badd317ae909cf185d04e.zip
Merge pull request #3521 from baude/golangcilint1
first pass of corrections for golangci-lint
Diffstat (limited to 'libpod/container_attach_linux.go')
-rw-r--r--libpod/container_attach_linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libpod/container_attach_linux.go b/libpod/container_attach_linux.go
index 17b09fccc..43dd7d579 100644
--- a/libpod/container_attach_linux.go
+++ b/libpod/container_attach_linux.go
@@ -10,6 +10,7 @@ import (
"path/filepath"
"github.com/containers/libpod/libpod/define"
+ "github.com/containers/libpod/pkg/errorhandling"
"github.com/containers/libpod/pkg/kubeutils"
"github.com/containers/libpod/utils"
"github.com/docker/docker/pkg/term"
@@ -66,7 +67,7 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi
logrus.Debugf("Could not open ctl file: %v", err)
return
}
- defer controlFile.Close()
+ defer errorhandling.CloseQuiet(controlFile)
logrus.Debugf("Received a resize event: %+v", size)
if _, err = fmt.Fprintf(controlFile, "%d %d %d\n", 1, size.Height, size.Width); err != nil {
@@ -108,7 +109,9 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi
var err error
if streams.AttachInput {
_, err = utils.CopyDetachable(conn, streams.InputStream, detachKeys)
- conn.CloseWrite()
+ if err := conn.CloseWrite(); err != nil {
+ logrus.Error("failed to close write in attach")
+ }
}
stdinDone <- err
}()