summaryrefslogtreecommitdiff
path: root/libpod/container_attach_linux.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-07-08 13:20:17 -0500
committerbaude <bbaude@redhat.com>2019-07-10 15:52:17 -0500
commite053e0e05ecd884067125627f0006d1b6e19226e (patch)
tree9e5bcca7703a041b23c2e3c9fcfe928e8bca2962 /libpod/container_attach_linux.go
parent81e722d08617ee19235bf57de6d86124e6b4574a (diff)
downloadpodman-e053e0e05ecd884067125627f0006d1b6e19226e.tar.gz
podman-e053e0e05ecd884067125627f0006d1b6e19226e.tar.bz2
podman-e053e0e05ecd884067125627f0006d1b6e19226e.zip
first pass of corrections for golangci-lint
Signed-off-by: baude <bbaude@redhat.com>
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
}()