Permalink
Browse files

Merge pull request #1895 from giuseppe/fix-tty-hang

tty: close epollConsole on errors
  • Loading branch information...
mrunalp committed Sep 20, 2018
2 parents 578fe65 + ec0d23a commit 00dc70017d222b178a002ed30e9321b12647af2d
Showing with 2 additions and 0 deletions.
  1. +2 −0 tty.go
View
2 tty.go
@@ -97,9 +97,11 @@ func (t *tty) recvtty(process *libcontainer.Process, socket *os.File) error {
// set raw mode to stdin and also handle interrupt
stdin, err := console.ConsoleFromFile(os.Stdin)
if err != nil {
epollConsole.Close()
return err
}
if err := stdin.SetRaw(); err != nil {
epollConsole.Close()
return fmt.Errorf("failed to set the terminal from the stdin: %v", err)
}
go handleInterrupt(stdin)

0 comments on commit 00dc700

Please sign in to comment.