Skip to content

Commit

Permalink
Set ClearONLCR in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
  • Loading branch information
crosbymichael committed Sep 25, 2017
1 parent 9ba16b6 commit f364c1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions contrib/cmd/recvtty/recvtty.go
Expand Up @@ -101,25 +101,26 @@ func handleSingle(path string) error {
if err != nil { if err != nil {
return err return err
} }
console, err := console.ConsoleFromFile(master) c, err := console.ConsoleFromFile(master)
if err != nil { if err != nil {
return err return err
} }
console.ClearONLCR(c.Fd())


// Copy from our stdio to the master fd. // Copy from our stdio to the master fd.
quitChan := make(chan struct{}) quitChan := make(chan struct{})
go func() { go func() {
io.Copy(os.Stdout, console) io.Copy(os.Stdout, c)
quitChan <- struct{}{} quitChan <- struct{}{}
}() }()
go func() { go func() {
io.Copy(console, os.Stdin) io.Copy(c, os.Stdin)
quitChan <- struct{}{} quitChan <- struct{}{}
}() }()


// Only close the master fd once we've stopped copying. // Only close the master fd once we've stopped copying.
<-quitChan <-quitChan
console.Close() c.Close()
return nil return nil
} }


Expand Down
2 changes: 1 addition & 1 deletion libcontainer/integration/execin_test.go
Expand Up @@ -309,7 +309,7 @@ func TestExecInTTY(t *testing.T) {
} }
return return
} }
console.SaneTerminal(f) console.ClearONLCR(c.Fd())
dc <- &cdata{ dc <- &cdata{
c: c, c: c,
} }
Expand Down
1 change: 1 addition & 0 deletions tty.go
Expand Up @@ -80,6 +80,7 @@ func (t *tty) recvtty(process *libcontainer.Process, socket *os.File) error {
if err != nil { if err != nil {
return err return err
} }
console.ClearONLCR(cons.Fd())
epoller, err := console.NewEpoller() epoller, err := console.NewEpoller()
if err != nil { if err != nil {
return err return err
Expand Down

0 comments on commit f364c1a

Please sign in to comment.