Fix attach stream closing issues

Fixes: #9860
Fixes: detach and attach tty mode

We never actually need to close container `stdin` after `stdout/stderr` finishes. We only need to close the `stdin` goroutine. In some cases this also means closing `stdin` but that is already controlled by the goroutine itself.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2015-01-14 02:03:25 +02:00
parent 5862422a49
commit 28cf8fddd4
2 changed files with 124 additions and 2 deletions
+1 -2
View File
@@ -179,9 +179,8 @@ func (daemon *Daemon) attach(streamConfig *StreamConfig, openStdin, stdinOnce, t
}
defer func() {
// Make sure stdin gets closed
if stdinOnce && cStdin != nil {
if stdin != nil {
stdin.Close()
cStdin.Close()
}
streamPipe.Close()
wg.Done()