diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-05-31 13:05:12 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-05-31 13:05:12 -0700 |
| commit | 182af5c2af5fab60033815664c4b1634d968e0a2 (patch) | |
| tree | aad32f3950d466d0c8e21d942f485561d65719c3 | |
| parent | f019a8b0f57d1ceced6be345d1d0135c91822da9 (diff) | |
Switched to use cfmakeraw() instead of manually setting a bunch of
termios bits.
| -rw-r--r-- | bb.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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) |
