Mercurial > hg > toybox
comparison toys/pending/getty.c @ 1361:b6226bf22826 draft
Glibc and uClibc provide CERASE from termios.h, but musl requies you to #include a non-posix header and the maintainer considers this a feature. So just use the constant directly.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 24 Jun 2014 21:47:07 -0500 |
parents | 0ecfaa7022e8 |
children | 27f608badc20 |
comparison
equal
deleted
inserted
replaced
1360:46f068aaa480 | 1361:b6226bf22826 |
---|---|
163 TT.termios.c_cc[VINTR] = CTL('C'); | 163 TT.termios.c_cc[VINTR] = CTL('C'); |
164 TT.termios.c_cc[VQUIT] = CTL('\\'); | 164 TT.termios.c_cc[VQUIT] = CTL('\\'); |
165 TT.termios.c_cc[VEOF] = CTL('D'); | 165 TT.termios.c_cc[VEOF] = CTL('D'); |
166 TT.termios.c_cc[VEOL] = '\n'; | 166 TT.termios.c_cc[VEOL] = '\n'; |
167 TT.termios.c_cc[VKILL] = CTL('U'); | 167 TT.termios.c_cc[VKILL] = CTL('U'); |
168 TT.termios.c_cc[VERASE] = CERASE; | 168 TT.termios.c_cc[VERASE] = 127; // CERASE |
169 TT.termios.c_iflag = ICRNL|IXON|IXOFF; | 169 TT.termios.c_iflag = ICRNL|IXON|IXOFF; |
170 // set non-zero baud rate. Zero baud rate left it unchanged. | 170 // set non-zero baud rate. Zero baud rate left it unchanged. |
171 if (TT.speeds[0] != B0) cfsetspeed(&TT.termios, TT.speeds[0]); | 171 if (TT.speeds[0] != B0) cfsetspeed(&TT.termios, TT.speeds[0]); |
172 if (tcsetattr(STDIN_FILENO, TCSANOW, &TT.termios) < 0) | 172 if (tcsetattr(STDIN_FILENO, TCSANOW, &TT.termios) < 0) |
173 perror_exit("tcsetattr"); | 173 perror_exit("tcsetattr"); |