FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 09-27-2011, 04:08 PM
Carlos Maiolino
 
Default 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

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
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( _("
Are you sure you want to proceed? [y/n] "));
- if(!fgets(input, 32, stdin))
- die( _("unable to read from stdin
"));
-
- if (input[0] != 'y')
- die( _("aborted
"));
- else
- printf("
");
+ are_you_sure();
}
}

--
1.7.6
 

Thread Tools




All times are GMT. The time now is 11:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org