unix: use cfmakeraw() for setting raw TTY mode

This commit is contained in:
Yuri D'Elia 2014-10-28 13:03:44 +01:00 committed by Saúl Ibarra Corretgé
parent e03c0c7383
commit 0f25560c8a

View File

@ -123,12 +123,7 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) {
uv_spinlock_unlock(&termios_spinlock);
raw = tty->orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag |= (ONLCR);
raw.c_cflag |= (CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
raw.c_cc[VMIN] = 1;
raw.c_cc[VTIME] = 0;
cfmakeraw(&raw);
/* Put terminal in raw mode after draining */
if (tcsetattr(fd, TCSADRAIN, &raw))