X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=libbb%2Fbb_askpass.c;h=9a4188f52f8303430a94a566b2026c15ac46b00c;hb=d84b175cb6948eb17f847313bf912174e2f934e1;hp=bdb756659efe56a01299f4cf439cb8f20739d3d0;hpb=e936c6d1c501517a68404612235c79e0a3600fad;p=oweals%2Fbusybox.git diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c index bdb756659..9a4188f52 100644 --- a/libbb/bb_askpass.c +++ b/libbb/bb_askpass.c @@ -5,7 +5,7 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" @@ -38,7 +38,7 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) #endif tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY); tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP); - tcsetattr_stdin_TCSANOW(&tio); + tcsetattr(fd, TCSANOW, &tio); memset(&sa, 0, sizeof(sa)); /* sa.sa_flags = 0; - no SA_RESTART! */ @@ -55,7 +55,6 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) if (!passwd) passwd = xmalloc(sizeof_passwd); - memset(passwd, 0, sizeof_passwd); ret = passwd; i = 0; while (1) { @@ -78,8 +77,7 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) alarm(0); } sigaction_set(SIGINT, &oldsa); - - tcsetattr_stdin_TCSANOW(&oldtio); + tcsetattr(fd, TCSANOW, &oldtio); bb_putchar('\n'); fflush_all(); return ret;