mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
Merge pull request #1895 from giuseppe/fix-tty-hang
tty: close epollConsole on errors
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user