From b9eb5e04aeac870a9a45ae8961cfb3578af26787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Thu, 24 Oct 2013 13:00:51 -0700 Subject: [PATCH] Ignore ErrClosedPipe for stdin in Container.Attach. But pass `err` in the error channel anyway; don't ignore it anymore. --- container.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/container.go b/container.go index 01d442fed0..b17f7d6421 100644 --- a/container.go +++ b/container.go @@ -470,11 +470,13 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s } else { _, err = io.Copy(cStdin, stdin) } + if err == io.ErrClosedPipe { + err = nil + } if err != nil { utils.Errorf("attach: stdin: %s", err) } - // Discard error, expecting pipe error - errors <- nil + errors <- err }() } }