diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-03 12:17:06 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-03 12:17:06 +0100 |
commit | 557deb1014c1c30a38bb7a7876a0dbc919b8ddad (patch) | |
tree | a4c2cc98cf53967f32be9e3d2c363f41976a7ea0 | |
parent | 659507f84e0e25eb0f3d6bfa9a9d807c89fc251e (diff) | |
download | busybox-w32-557deb1014c1c30a38bb7a7876a0dbc919b8ddad.tar.gz busybox-w32-557deb1014c1c30a38bb7a7876a0dbc919b8ddad.tar.bz2 busybox-w32-557deb1014c1c30a38bb7a7876a0dbc919b8ddad.zip |
libbb: fix bb_ask() to operate on correct fd
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/bb_askpass.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c index bf4578050..12ebe179e 100644 --- a/libbb/bb_askpass.c +++ b/libbb/bb_askpass.c | |||
@@ -38,7 +38,7 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) | |||
38 | #endif | 38 | #endif |
39 | tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY); | 39 | tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY); |
40 | tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP); | 40 | tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP); |
41 | tcsetattr_stdin_TCSANOW(&tio); | 41 | tcsetattr(fd, TCSANOW, &tio); |
42 | 42 | ||
43 | memset(&sa, 0, sizeof(sa)); | 43 | memset(&sa, 0, sizeof(sa)); |
44 | /* sa.sa_flags = 0; - no SA_RESTART! */ | 44 | /* sa.sa_flags = 0; - no SA_RESTART! */ |
@@ -77,8 +77,7 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) | |||
77 | alarm(0); | 77 | alarm(0); |
78 | } | 78 | } |
79 | sigaction_set(SIGINT, &oldsa); | 79 | sigaction_set(SIGINT, &oldsa); |
80 | 80 | tcsetattr(fd, TCSANOW, &oldtio); | |
81 | tcsetattr_stdin_TCSANOW(&oldtio); | ||
82 | bb_putchar('\n'); | 81 | bb_putchar('\n'); |
83 | fflush_all(); | 82 | fflush_all(); |
84 | return ret; | 83 | return ret; |