aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xfuncs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 388b246ca..bf15f4c75 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -311,13 +311,12 @@ int FAST_FUNC is_TERM_dumb(void)
311 return term && strcmp(term, "dumb") == 0; 311 return term && strcmp(term, "dumb") == 0;
312} 312}
313 313
314#if !ENABLE_PLATFORM_MINGW32
315int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp) 314int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp)
316{ 315{
317 return tcsetattr(STDIN_FILENO, TCSANOW, tp); 316 return tcsetattr(STDIN_FILENO, TCSANOW, tp);
318} 317}
319 318
320int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct termios *oldterm, int flags) 319int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct termios *oldterm, int flags IF_PLATFORM_MINGW32(UNUSED_PARAM))
321{ 320{
322//TODO: slattach, shell read might be adapted to use this too: grep for "tcsetattr", "[VTIME] = 0" 321//TODO: slattach, shell read might be adapted to use this too: grep for "tcsetattr", "[VTIME] = 0"
323 int r; 322 int r;
@@ -326,6 +325,9 @@ int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct t
326 r = tcgetattr(fd, oldterm); 325 r = tcgetattr(fd, oldterm);
327 *newterm = *oldterm; 326 *newterm = *oldterm;
328 327
328#if ENABLE_PLATFORM_MINGW32
329 newterm->imode &= ~(ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT);
330#else
329 /* Turn off buffered input (ICANON) 331 /* Turn off buffered input (ICANON)
330 * Turn off echoing (ECHO) 332 * Turn off echoing (ECHO)
331 * and separate echoing of newline (ECHONL, normally off anyway) 333 * and separate echoing of newline (ECHONL, normally off anyway)
@@ -382,6 +384,7 @@ int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct t
382 */ 384 */
383 newterm->c_iflag &= ~(IXOFF|IXON|IXANY|BRKINT|INLCR|ICRNL|IUCLC|IMAXBEL); 385 newterm->c_iflag &= ~(IXOFF|IXON|IXANY|BRKINT|INLCR|ICRNL|IUCLC|IMAXBEL);
384 } 386 }
387#endif
385 return r; 388 return r;
386} 389}
387 390
@@ -392,7 +395,6 @@ int FAST_FUNC set_termios_to_raw(int fd, struct termios *oldterm, int flags)
392 get_termios_and_make_raw(fd, &newterm, oldterm, flags); 395 get_termios_and_make_raw(fd, &newterm, oldterm, flags);
393 return tcsetattr(fd, TCSANOW, &newterm); 396 return tcsetattr(fd, TCSANOW, &newterm);
394} 397}
395#endif
396 398
397pid_t FAST_FUNC safe_waitpid(pid_t pid, int *wstat, int options) 399pid_t FAST_FUNC safe_waitpid(pid_t pid, int *wstat, int options)
398{ 400{