summaryrefslogtreecommitdiff
path: root/libpod/oci_attach_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-02 16:43:11 +0200
committerGitHub <noreply@github.com>2020-04-02 16:43:11 +0200
commitc3c6a7c8236fb43c3bc7172257b7fb15921e1668 (patch)
tree2ad7035788a494b5cbf0a945320127570643e037 /libpod/oci_attach_linux.go
parentffd2d783919e6038fe55e3e6b8cf44c0b3356a96 (diff)
parentd172c987144a2140da608e81b2595a84bef4c163 (diff)
downloadpodman-c3c6a7c8236fb43c3bc7172257b7fb15921e1668.tar.gz
podman-c3c6a7c8236fb43c3bc7172257b7fb15921e1668.tar.bz2
podman-c3c6a7c8236fb43c3bc7172257b7fb15921e1668.zip
Merge pull request #5677 from giuseppe/avoid-lock-tty
exec: fix hang if control path is deleted
Diffstat (limited to 'libpod/oci_attach_linux.go')
-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