1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #34386 from tklauser/pkg-term-makeraw-fix

pkg/term: set termios VMIN and VTIME in MakeRaw on Linux
This commit is contained in:
Kenfe-Mickaël Laventure 2017-08-07 16:34:40 +02:00 committed by GitHub
commit 6f1907898f

View file

@ -29,6 +29,8 @@ func MakeRaw(fd uintptr) (*State, error) {
termios.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN) termios.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN)
termios.Cflag &^= (unix.CSIZE | unix.PARENB) termios.Cflag &^= (unix.CSIZE | unix.PARENB)
termios.Cflag |= unix.CS8 termios.Cflag |= unix.CS8
termios.Cc[unix.VMIN] = 1
termios.Cc[unix.VTIME] = 0
if err := unix.IoctlSetTermios(int(fd), setTermios, termios); err != nil { if err := unix.IoctlSetTermios(int(fd), setTermios, termios); err != nil {
return nil, err return nil, err