Fix tty copy for driver

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 172260a49be6c3516edc6869d58957e844f9c69b
Component: engine
This commit is contained in:
Michael Crosby
2014-02-22 01:28:59 -08:00
parent 0c8ed4441e
commit 0b2fdfff35

View File

@ -8,6 +8,7 @@ import (
"github.com/dotcloud/docker/execdriver/lxc"
"github.com/dotcloud/docker/pkg/libcontainer"
"github.com/dotcloud/docker/pkg/libcontainer/nsinit"
"io"
"io/ioutil"
"os"
"os/exec"
@ -203,7 +204,11 @@ type dockerTtyTerm struct {
}
func (t *dockerTtyTerm) Attach(cmd *exec.Cmd) error {
return t.AttachPipes(cmd, t.pipes)
go io.Copy(t.pipes.Stdout, t.MasterPty)
if t.pipes.Stdin != nil {
go io.Copy(t.MasterPty, t.pipes.Stdin)
}
return nil
}
func (t *dockerTtyTerm) SetMaster(master *os.File) {