libbb: rename bb_ask -> bb_ask_noecho, bb_ask_confirmation -> bb_ask_y_confirmation

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-04-07 15:08:12 +02:00
parent 2f094ae821
commit 77cb6b99a4
11 changed files with 24 additions and 24 deletions

View File

@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
* bb_ask_confirmation implementation for busybox
* bb_ask_y_confirmation implementation for busybox
*
* Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
*
@ -11,7 +11,7 @@
/* Read a line from stdin. If the first non-whitespace char is 'y' or 'Y',
* return 1. Otherwise return 0.
*/
int FAST_FUNC bb_ask_confirmation(void)
int FAST_FUNC bb_ask_y_confirmation(void)
{
char first = 0;
int c;

View File

@ -13,11 +13,11 @@ static void askpass_timeout(int UNUSED_PARAM ignore)
{
}
char* FAST_FUNC bb_ask_stdin(const char *prompt)
char* FAST_FUNC bb_ask_noecho_stdin(const char *prompt)
{
return bb_ask(STDIN_FILENO, 0, prompt);
return bb_ask_noecho(STDIN_FILENO, 0, prompt);
}
char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt)
char* FAST_FUNC bb_ask_noecho(const int fd, int timeout, const char *prompt)
{
/* Was static char[BIGNUM] */
enum { sizeof_passwd = 128 };

View File

@ -48,7 +48,7 @@ static int ask_and_unlink(const char *dest, int flags)
// (No "opening without O_EXCL", no "unlink only if -f")
// Or else we will end up having 3 open()s!
fprintf(stderr, "%s: overwrite '%s'? ", applet_name, dest);
if (!bb_ask_confirmation())
if (!bb_ask_y_confirmation())
return 0; /* not allowed to overwrite */
}
if (unlink(dest) < 0) {

View File

@ -106,7 +106,7 @@ int FAST_FUNC ask_and_check_password_extended(const struct passwd *pw,
if (!pw_pass[0]) /* empty password field? */
return CHECKPASS_PW_HAS_EMPTY_PASSWORD;
plaintext = bb_ask(STDIN_FILENO, timeout, prompt);
plaintext = bb_ask_noecho(STDIN_FILENO, timeout, prompt);
if (!plaintext) {
/* EOF (such as ^D) or error (such as ^C) or timeout */
return -1;

View File

@ -41,7 +41,7 @@ int FAST_FUNC remove_file(const char *path, int flags)
) {
fprintf(stderr, "%s: descend into directory '%s'? ", applet_name,
path);
if (!bb_ask_confirmation())
if (!bb_ask_y_confirmation())
return 0;
}
@ -68,7 +68,7 @@ int FAST_FUNC remove_file(const char *path, int flags)
if (flags & FILEUTILS_INTERACTIVE) {
fprintf(stderr, "%s: remove directory '%s'? ", applet_name, path);
if (!bb_ask_confirmation())
if (!bb_ask_y_confirmation())
return status;
}
@ -92,7 +92,7 @@ int FAST_FUNC remove_file(const char *path, int flags)
|| (flags & FILEUTILS_INTERACTIVE)
) {
fprintf(stderr, "%s: remove '%s'? ", applet_name, path);
if (!bb_ask_confirmation())
if (!bb_ask_y_confirmation())
return 0;
}