Gitweb:
http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 8ac1662541ff772291118c57950b1199cc095a94
Parent: f768a73ba0657ae3d0d69eac3acd40c4f567c76a
Author: Carlos Maiolino <cmaiolino(a)redhat.com>
AuthorDate: Tue Sep 27 11:00:31 2011 -0300
Committer: Carlos Maiolino <cmaiolino(a)redhat.com>
CommitterDate: Tue Sep 27 15:23:17 2011 -0300
mkfs: remove duplicated code to ask yes/no question
This patch takes advantage of the are_you_sure() function
to ask a yes/no question within verify_bsize() function
---
gfs2/mkfs/main_mkfs.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 8802ef7..0bd1410 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -350,14 +350,7 @@ static void verify_bsize(struct gfs2_sbd *sdp)
if (sdp->override)
return;
- printf( _("\nAre you sure you want to proceed? [y/n] "));
- if(!fgets(input, 32, stdin))
- die( _("unable to read from stdin\n"));
-
- if (input[0] != 'y')
- die( _("aborted\n"));
- else
- printf("\n");
+ are_you_sure();
}
}