From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlos Maiolino Date: Tue, 27 Sep 2011 13:08:23 -0300 Subject: [Cluster-devel] [PATCH 3/3] mkfs: remove duplicated code to ask yes/no question In-Reply-To: <1317139703-2755-2-git-send-email-cmaiolino@redhat.com> References: <1317139703-2755-1-git-send-email-cmaiolino@redhat.com> <1317139703-2755-2-git-send-email-cmaiolino@redhat.com> Message-ID: <1317139703-2755-3-git-send-email-cmaiolino@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch takes advantage of the are_you_sure() function to ask a yes/no question within verify_bsize() function Signed-off-by: Carlos Maiolino --- 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(); } } -- 1.7.6