mirror of
https://github.com/sheumann/hush.git
synced 2025-01-02 09:31:26 +00:00
libbb: fix bb_ask() to operate on correct fd
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
659507f84e
commit
557deb1014
@ -38,7 +38,7 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt)
|
|||||||
#endif
|
#endif
|
||||||
tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
|
tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
|
||||||
tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP);
|
tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP);
|
||||||
tcsetattr_stdin_TCSANOW(&tio);
|
tcsetattr(fd, TCSANOW, &tio);
|
||||||
|
|
||||||
memset(&sa, 0, sizeof(sa));
|
memset(&sa, 0, sizeof(sa));
|
||||||
/* sa.sa_flags = 0; - no SA_RESTART! */
|
/* sa.sa_flags = 0; - no SA_RESTART! */
|
||||||
@ -77,8 +77,7 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt)
|
|||||||
alarm(0);
|
alarm(0);
|
||||||
}
|
}
|
||||||
sigaction_set(SIGINT, &oldsa);
|
sigaction_set(SIGINT, &oldsa);
|
||||||
|
tcsetattr(fd, TCSANOW, &oldtio);
|
||||||
tcsetattr_stdin_TCSANOW(&oldtio);
|
|
||||||
bb_putchar('\n');
|
bb_putchar('\n');
|
||||||
fflush_all();
|
fflush_all();
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user