mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
Add the function 'confirm_yesno' for interactive
User's confirmation is asked in different commands. This commit adds a function for such confirmation. Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Pierre Aubert <p.aubert@staubli.com>
This commit is contained in:
parent
91fdabc67a
commit
a5dffa4b67
5 changed files with 37 additions and 36 deletions
|
@ -605,22 +605,16 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
opts.spread = spread;
|
||||
|
||||
if (scrub) {
|
||||
if (!scrub_yes)
|
||||
puts(scrub_warn);
|
||||
|
||||
if (scrub_yes)
|
||||
if (scrub_yes) {
|
||||
opts.scrub = 1;
|
||||
else if (getc() == 'y') {
|
||||
puts("y");
|
||||
if (getc() == '\r')
|
||||
} else {
|
||||
puts(scrub_warn);
|
||||
if (confirm_yesno()) {
|
||||
opts.scrub = 1;
|
||||
else {
|
||||
} else {
|
||||
puts("scrub aborted\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
puts("scrub aborted\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
ret = nand_erase_opts(nand, &opts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue