Permalink
Browse files

Set ClearONLCR in tests

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
  • Loading branch information...
crosbymichael committed Sep 25, 2017
1 parent 9ba16b6 commit f364c1a58c90d98377db130660a19a61a923832a
Showing with 7 additions and 5 deletions.
  1. +5 −4 contrib/cmd/recvtty/recvtty.go
  2. +1 −1 libcontainer/integration/execin_test.go
  3. +1 −0 tty.go
@@ -101,25 +101,26 @@ func handleSingle(path string) error {
if err != nil {
return err
}
console, err := console.ConsoleFromFile(master)
c, err := console.ConsoleFromFile(master)
if err != nil {
return err
}
console.ClearONLCR(c.Fd())
// Copy from our stdio to the master fd.
quitChan := make(chan struct{})
go func() {
io.Copy(os.Stdout, console)
io.Copy(os.Stdout, c)
quitChan <- struct{}{}
}()
go func() {
io.Copy(console, os.Stdin)
io.Copy(c, os.Stdin)
quitChan <- struct{}{}
}()
// Only close the master fd once we've stopped copying.
<-quitChan
console.Close()
c.Close()
return nil
}
@@ -309,7 +309,7 @@ func TestExecInTTY(t *testing.T) {
}
return
}
console.SaneTerminal(f)
console.ClearONLCR(c.Fd())
dc <- &cdata{
c: c,
}
View
1 tty.go
@@ -80,6 +80,7 @@ func (t *tty) recvtty(process *libcontainer.Process, socket *os.File) error {
if err != nil {
return err
}
console.ClearONLCR(cons.Fd())
epoller, err := console.NewEpoller()
if err != nil {
return err

0 comments on commit f364c1a

Please sign in to comment.