1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix tty copy for driver

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-02-22 01:28:59 -08:00
parent fac41af25b
commit 172260a49b

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) {