On 16:04 Sun 06 Jul , Harald Welte wrote:
> [PATCH] add explicit bbt creation to commandline ("nand createbbt" command)
>
> This patch adds user-requested BBT creation. It includes the following
> changes:
>
> - common/cmd_nand.c: move yes/no decision to separate function
> - do_nand: ask for confirmation for "nand erase"
> - do_nand: add command "nand createbbt" to erase NAND and create a new BBT
>
> Signed-off-by: Werner Almesberger <[EMAIL PROTECTED]>
> Signed-off-by: Harald Welte <[EMAIL PROTECTED]>
>
> ---
>
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index bb46f34..2f41157 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -162,6 +162,17 @@ out:
> return 0;
> }
>
> +static int yes(void)
> +{
> + char c;
> +
> + c = getc();
> + if (c != 'y' && c != 'Y')
> + return 0;
> + c = getc();
> + return c == '\r' || c == '\n';
> +}
> +
It will be good to have it in a re-usable header as inline.
And why not name it as "ask_confirm()"?
Best Regards,
J.
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users