diff options
-rw-r--r-- | init/init.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/init/init.c b/init/init.c index 0f3c5fa4d..db1d99add 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -145,13 +145,6 @@ | |||
145 | # include <sys/ucontext.h> | 145 | # include <sys/ucontext.h> |
146 | #endif | 146 | #endif |
147 | 147 | ||
148 | /* Used only for sanitizing purposes in set_sane_term() below. On systems where | ||
149 | * the baud rate is stored in a separate field, we can safely disable them. */ | ||
150 | #ifndef CBAUD | ||
151 | # define CBAUD 0 | ||
152 | # define CBAUDEX 0 | ||
153 | #endif | ||
154 | |||
155 | /* Was a CONFIG_xxx option. A lot of people were building | 148 | /* Was a CONFIG_xxx option. A lot of people were building |
156 | * not fully functional init by switching it on! */ | 149 | * not fully functional init by switching it on! */ |
157 | #define DEBUG_INIT 0 | 150 | #define DEBUG_INIT 0 |
@@ -347,7 +340,8 @@ static void set_sane_term(void) | |||
347 | { | 340 | { |
348 | struct termios tty; | 341 | struct termios tty; |
349 | 342 | ||
350 | tcgetattr(STDIN_FILENO, &tty); | 343 | if (tcgetattr(STDIN_FILENO, &tty) != 0) |
344 | return; | ||
351 | 345 | ||
352 | /* set control chars */ | 346 | /* set control chars */ |
353 | tty.c_cc[VINTR] = 3; /* C-c */ | 347 | tty.c_cc[VINTR] = 3; /* C-c */ |
@@ -365,10 +359,15 @@ static void set_sane_term(void) | |||
365 | #endif | 359 | #endif |
366 | 360 | ||
367 | /* Make it be sane */ | 361 | /* Make it be sane */ |
362 | /* On systems where the baud rate is stored in a separate field, we can safely disable these. */ | ||
363 | #ifndef CBAUD | ||
364 | # define CBAUD 0 | ||
365 | # define CBAUDEX 0 | ||
366 | #endif | ||
367 | /* Added CRTSCTS to fix Debian bug 528560 */ | ||
368 | #ifndef CRTSCTS | 368 | #ifndef CRTSCTS |
369 | # define CRTSCTS 0 | 369 | # define CRTSCTS 0 |
370 | #endif | 370 | #endif |
371 | /* added CRTSCTS to fix Debian bug 528560 */ | ||
372 | tty.c_cflag &= CBAUD | CBAUDEX | CSIZE | CSTOPB | PARENB | PARODD | CRTSCTS; | 371 | tty.c_cflag &= CBAUD | CBAUDEX | CSIZE | CSTOPB | PARENB | PARODD | CRTSCTS; |
373 | tty.c_cflag |= CREAD | HUPCL | CLOCAL; | 372 | tty.c_cflag |= CREAD | HUPCL | CLOCAL; |
374 | 373 | ||