aboutsummaryrefslogtreecommitdiff
path: root/bb.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-05-31 13:05:12 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-05-31 13:05:12 -0700
commit182af5c2af5fab60033815664c4b1634d968e0a2 (patch)
treeaad32f3950d466d0c8e21d942f485561d65719c3 /bb.c
parentf019a8b0f57d1ceced6be345d1d0135c91822da9 (diff)
Switched to use cfmakeraw() instead of manually setting a bunch of
termios bits.
Diffstat (limited to 'bb.c')
-rw-r--r--bb.c7
1 files changed, 1 insertions, 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)