Skip to content

Commit 00dc700

Browse files
author
Mrunal Patel
authored
Merge pull request opencontainers#1895 from giuseppe/fix-tty-hang
tty: close epollConsole on errors
2 parents 578fe65 + ec0d23a commit 00dc700

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tty.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ func (t *tty) recvtty(process *libcontainer.Process, socket *os.File) error {
9797
// set raw mode to stdin and also handle interrupt
9898
stdin, err := console.ConsoleFromFile(os.Stdin)
9999
if err != nil {
100+
epollConsole.Close()
100101
return err
101102
}
102103
if err := stdin.SetRaw(); err != nil {
104+
epollConsole.Close()
103105
return fmt.Errorf("failed to set the terminal from the stdin: %v", err)
104106
}
105107
go handleInterrupt(stdin)

0 commit comments

Comments
 (0)