cmd_nand: show nand scrub confirmation character
When issuing a nand scrub command, the entered character is not displayed this may be confusing. This patch makes the input character being displayed if it is a 'y' so that an user knows he is about to scrub his nand. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
This commit is contained in:
parent
7c27b7b1ea
commit
6b94b49622
@ -327,8 +327,14 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
|||||||
"are sure of what you are doing!\n"
|
"are sure of what you are doing!\n"
|
||||||
"\nReally scrub this NAND flash? <y/N>\n");
|
"\nReally scrub this NAND flash? <y/N>\n");
|
||||||
|
|
||||||
if (getc() == 'y' && getc() == '\r') {
|
if (getc() == 'y') {
|
||||||
opts.scrub = 1;
|
puts("y");
|
||||||
|
if (getc() == '\r')
|
||||||
|
opts.scrub = 1;
|
||||||
|
else {
|
||||||
|
puts("scrub aborted\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
puts("scrub aborted\n");
|
puts("scrub aborted\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user