diff options
author | Pierre Aubert <p.aubert@staubli.com> | 2014-04-24 10:30:07 +0200 |
---|---|---|
committer | Pantelis Antoniou <panto@antoniou-consulting.com> | 2014-05-23 11:53:05 +0300 |
commit | a5dffa4b67fb0ad635088c9853abf6fcb181ac3c (patch) | |
tree | 5fd9cf1fc261a3ad69045731c1ccdfcb0caaa75e /common/cmd_fuse.c | |
parent | 91fdabc67aebc2468ad362c02449f215e0971c68 (diff) | |
download | u-boot-midas-a5dffa4b67fb0ad635088c9853abf6fcb181ac3c.tar.gz u-boot-midas-a5dffa4b67fb0ad635088c9853abf6fcb181ac3c.tar.bz2 u-boot-midas-a5dffa4b67fb0ad635088c9853abf6fcb181ac3c.zip |
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>
Diffstat (limited to 'common/cmd_fuse.c')
-rw-r--r-- | common/cmd_fuse.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/common/cmd_fuse.c b/common/cmd_fuse.c index 0df57dbc80..abab9789b0 100644 --- a/common/cmd_fuse.c +++ b/common/cmd_fuse.c @@ -33,15 +33,8 @@ static int confirm_prog(void) "what you are doing!\n" "\nReally perform this fuse programming? <y/N>\n"); - if (getc() == 'y') { - int c; - - putc('y'); - c = getc(); - putc('\n'); - if (c == '\r') - return 1; - } + if (confirm_yesno()) + return 1; puts("Fuse programming aborted\n"); return 0; |