summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-19 05:13:49 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-19 05:13:49 +0000
commit6c41c448982827ef5bfac9bac14bc9e509f45bc4 (patch)
tree6f022d62f6b2a83561c877de0df6b97916c04bb6 /init
parent531bcb6826e414f08a74d0a0c1b3ca91acfec74a (diff)
downloadbusybox-w32-6c41c448982827ef5bfac9bac14bc9e509f45bc4.tar.gz
busybox-w32-6c41c448982827ef5bfac9bac14bc9e509f45bc4.tar.bz2
busybox-w32-6c41c448982827ef5bfac9bac14bc9e509f45bc4.zip
Adjust the termio settings, and don't use octal since it
is impossible to read by mere mortals. -Erik
Diffstat (limited to 'init')
-rw-r--r--init/init.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/init/init.c b/init/init.c
index c6052f8cf..f0124a225 100644
--- a/init/init.c
+++ b/init/init.c
@@ -191,23 +191,25 @@ void message(int device, char *fmt, ...)
191void set_term(int fd) 191void set_term(int fd)
192{ 192{
193 struct termios tty; 193 struct termios tty;
194 static const char control_characters[] = {
195 '\003', '\034', '\177', '\025', '\004', '\0',
196 '\1', '\0', '\021', '\023', '\032', '\0', '\022',
197 '\017', '\027', '\026', '\0'
198 };
199 194
200 tcgetattr(fd, &tty); 195 tcgetattr(fd, &tty);
201 196
202 /* set control chars */ 197 /* set control chars */
203 memcpy(tty.c_cc, control_characters, sizeof(control_characters)); 198 tty.c_cc[VINTR] = 3; /* C-c */
199 tty.c_cc[VQUIT] = 28; /* C-\ */
200 tty.c_cc[VERASE] = 127; /* C-? */
201 tty.c_cc[VKILL] = 21; /* C-u */
202 tty.c_cc[VEOF] = 4; /* C-d */
203 tty.c_cc[VSTART] = 17; /* C-q */
204 tty.c_cc[VSTOP] = 19; /* C-s */
205 tty.c_cc[VSUSP] = 26; /* C-z */
204 206
205 /* use line dicipline 0 */ 207 /* use line dicipline 0 */
206 tty.c_line = 0; 208 tty.c_line = 0;
207 209
208 /* Make it be sane */ 210 /* Make it be sane */
209 //tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD; 211 tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD;
210 //tty.c_cflag |= HUPCL|CLOCAL; 212 tty.c_cflag |= HUPCL|CLOCAL;
211 213
212 /* input modes */ 214 /* input modes */
213 tty.c_iflag = ICRNL | IXON | IXOFF; 215 tty.c_iflag = ICRNL | IXON | IXOFF;