diff options
Diffstat (limited to 'libbb/xfuncs.c')
-rw-r--r-- | libbb/xfuncs.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index 6fa21ad00..57bda6204 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -333,7 +333,6 @@ int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct t | |||
333 | newterm->c_cc[VMIN] = 1; | 333 | newterm->c_cc[VMIN] = 1; |
334 | /* no timeout (reads block forever) */ | 334 | /* no timeout (reads block forever) */ |
335 | newterm->c_cc[VTIME] = 0; | 335 | newterm->c_cc[VTIME] = 0; |
336 | if (flags & TERMIOS_RAW_CRNL) { | ||
337 | /* IXON, IXOFF, and IXANY: | 336 | /* IXON, IXOFF, and IXANY: |
338 | * IXOFF=1: sw flow control is enabled on input queue: | 337 | * IXOFF=1: sw flow control is enabled on input queue: |
339 | * tty transmits a STOP char when input queue is close to full | 338 | * tty transmits a STOP char when input queue is close to full |
@@ -343,9 +342,12 @@ int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct t | |||
343 | * and resume sending if START is received, or if any char | 342 | * and resume sending if START is received, or if any char |
344 | * is received and IXANY=1. | 343 | * is received and IXANY=1. |
345 | */ | 344 | */ |
345 | if (flags & TERMIOS_RAW_CRNL_INPUT) { | ||
346 | /* IXON=0: XON/XOFF chars are treated as normal chars (why we do this?) */ | 346 | /* IXON=0: XON/XOFF chars are treated as normal chars (why we do this?) */ |
347 | /* dont convert CR to NL on input */ | 347 | /* dont convert CR to NL on input */ |
348 | newterm->c_iflag &= ~(IXON | ICRNL); | 348 | newterm->c_iflag &= ~(IXON | ICRNL); |
349 | } | ||
350 | if (flags & TERMIOS_RAW_CRNL_OUTPUT) { | ||
349 | /* dont convert NL to CR+NL on output */ | 351 | /* dont convert NL to CR+NL on output */ |
350 | newterm->c_oflag &= ~(ONLCR); | 352 | newterm->c_oflag &= ~(ONLCR); |
351 | /* Maybe clear more c_oflag bits? Usually, only OPOST and ONLCR are set. | 353 | /* Maybe clear more c_oflag bits? Usually, only OPOST and ONLCR are set. |
@@ -366,9 +368,12 @@ int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct t | |||
366 | #ifndef IXANY | 368 | #ifndef IXANY |
367 | # define IXANY 0 | 369 | # define IXANY 0 |
368 | #endif | 370 | #endif |
369 | /* IXOFF=0: disable sending XON/XOFF if input buf is full */ | 371 | /* IXOFF=0: disable sending XON/XOFF if input buf is full |
370 | /* IXON=0: input XON/XOFF chars are not special */ | 372 | * IXON=0: input XON/XOFF chars are not special |
371 | /* dont convert anything on input */ | 373 | * BRKINT=0: dont send SIGINT on break |
374 | * IMAXBEL=0: dont echo BEL on input line too long | ||
375 | * INLCR,ICRNL,IUCLC: dont convert anything on input | ||
376 | */ | ||
372 | newterm->c_iflag &= ~(IXOFF|IXON|IXANY|BRKINT|INLCR|ICRNL|IUCLC|IMAXBEL); | 377 | newterm->c_iflag &= ~(IXOFF|IXON|IXANY|BRKINT|INLCR|ICRNL|IUCLC|IMAXBEL); |
373 | } | 378 | } |
374 | return r; | 379 | return r; |