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.
@@ -200,10 +200,12 @@ func setupStdioChannels(streams *AttachStreams, conn *net.UnixConn, detachKeys [
var err error
if streams.AttachInput {
_, err = utils.CopyDetachable(conn, streams.InputStream, detachKeys)
+ if err == nil {
if connErr := conn.CloseWrite(); connErr != nil {
logrus.Errorf("unable to close conn: %q", connErr)
}
}
+ }
stdinDone <- err
}()
