diff options
| author | Florian Fainelli <f.fainelli@gmail.com> | 2010-03-20 19:02:58 +0100 | 
|---|---|---|
| committer | Scott Wood <scottwood@freescale.com> | 2010-03-23 14:29:10 -0500 | 
| commit | 6b94b4962211c16ee2197048faa887e1f92f3757 (patch) | |
| tree | f50d9ea4c54f40574648e4d9ea79e05cac8fbc29 /common/cmd_nand.c | |
| parent | 7c27b7b1eac43cdcda735bad6231cdfc1f602284 (diff) | |
| download | olio-uboot-2014.01-6b94b4962211c16ee2197048faa887e1f92f3757.tar.xz olio-uboot-2014.01-6b94b4962211c16ee2197048faa887e1f92f3757.zip | |
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>
Diffstat (limited to 'common/cmd_nand.c')
| -rw-r--r-- | common/cmd_nand.c | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 075a8afb6..9b0c93053 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -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"  			     "\nReally scrub this NAND flash? <y/N>\n"); -			if (getc() == 'y' && getc() == '\r') { -				opts.scrub = 1; +			if (getc() == 'y') { +				puts("y"); +				if (getc() == '\r') +					opts.scrub = 1; +				else { +					puts("scrub aborted\n"); +					return -1; +				}  			} else {  				puts("scrub aborted\n");  				return -1; |