mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08: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:

committed by
Pantelis Antoniou

parent
91fdabc67a
commit
a5dffa4b67
@ -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);
|
||||
|
Reference in New Issue
Block a user