summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-01 11:11:23 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-02 09:15:57 +0200
commit41fc891173382c126ed1f902f46f2cac46fff924 (patch)
tree593f39f90bb33b896aff4fd583095fde2b2f3f53 /libpod
parent4c02aa46c2873eaa89060f97f28a0c41c500ff90 (diff)
downloadpodman-41fc891173382c126ed1f902f46f2cac46fff924.tar.gz
podman-41fc891173382c126ed1f902f46f2cac46fff924.tar.bz2
podman-41fc891173382c126ed1f902f46f2cac46fff924.zip
attach: skip shutdown on errors
skip doing a socket shutdown on an error, since we are not sure the socket was already closed and we end up using the wrong fd. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/oci_attach_linux.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/oci_attach_linux.go b/libpod/oci_attach_linux.go
index 433993edb..fb0a54bff 100644
--- a/libpod/oci_attach_linux.go
+++ b/libpod/oci_attach_linux.go
@@ -200,8 +200,10 @@ func setupStdioChannels(streams *AttachStreams, conn *net.UnixConn, detachKeys [
var err error
if streams.AttachInput {
_, err = utils.CopyDetachable(conn, streams.InputStream, detachKeys)
- if connErr := conn.CloseWrite(); connErr != nil {
- logrus.Errorf("unable to close conn: %q", connErr)
+ if err == nil {
+ if connErr := conn.CloseWrite(); connErr != nil {
+ logrus.Errorf("unable to close conn: %q", connErr)
+ }
}
}
stdinDone <- err