From 182af5c2af5fab60033815664c4b1634d968e0a2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 31 May 2019 13:05:12 -0700 Subject: [PATCH] Switched to use cfmakeraw() instead of manually setting a bunch of termios bits. --- bb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bb.c b/bb.c index ccde76f..4b87413 100644 --- a/bb.c +++ b/bb.c @@ -192,12 +192,7 @@ void init_term(void) tty_out = fopen("/dev/tty", "w"); tcgetattr(fileno(tty_out), &orig_termios); memcpy(&bb_termios, &orig_termios, sizeof(bb_termios)); - bb_termios.c_iflag &= ~(unsigned long)( - IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); - bb_termios.c_oflag &= (unsigned long)~OPOST; - bb_termios.c_lflag &= (unsigned long)~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); - bb_termios.c_cflag &= (unsigned long)~(CSIZE | PARENB); - bb_termios.c_cflag |= (unsigned long)CS8; + cfmakeraw(&bb_termios); bb_termios.c_cc[VMIN] = 0; bb_termios.c_cc[VTIME] = 0; if (tcsetattr(fileno(tty_out), TCSAFLUSH, &bb_termios) == -1)