Bugfix: only use io.Copy in hijack if attaching both stdout and stderr

Add regression tests to ensure issue is fixed.

Docker-DCO-1.1-Signed-off-by: Matt Heon <mheon@redhat.com> (github: mheon)
Upstream-commit: 1476f295aca20e1c35383c133219d54a5373183f
Component: engine
This commit is contained in:
Matthew Heon
2014-07-17 13:47:33 -04:00
committed by Matthew Heon
parent bcb367a385
commit e650e69f7d
2 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
}()
// When TTY is ON, use regular copy
if setRawTerminal {
if setRawTerminal && stdout != nil {
_, err = io.Copy(stdout, br)
} else {
_, err = utils.StdCopy(stdout, stderr, br)