From d8b5f777438445407f7cd408bd5fe301e4687271 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 12 Nov 2006 23:09:03 -0500 Subject: [PATCH] Add explanatory message to badblocks that -n and -w are mutually exclusive Addresses Debian Bug: #371869 Signed-off-by: "Theodore Ts'o" --- misc/ChangeLog | 7 +++++++ misc/badblocks.c | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index fb50257..fdcf4ce 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,10 @@ +2006-11-12 Theodore Tso + + * badblocks.c (exclusive_usage): Add an explicit usage message + explaining to the user that the -n and -w message may not + be specified at the same time. (Addresses Debian Bug: + #371869) + 2006-11-08 Theodore Tso * mke2fs.c (test_disk): Change the last_block argument passed to diff --git a/misc/badblocks.c b/misc/badblocks.c index 40962fb..9867668 100644 --- a/misc/badblocks.c +++ b/misc/badblocks.c @@ -81,6 +81,13 @@ static void usage(void) exit (1); } +static void exclusive_usage(void) +{ + fprintf(stderr, + _("The -n and -w options are mutually exclusive.\n\n")); + usage(); +} + static unsigned long currently_testing = 0; static unsigned long num_blocks = 0; static ext2_badblocks_list bb_list = NULL; @@ -880,13 +887,13 @@ int main (int argc, char ** argv) break; case 'w': if (w_flag) - usage(); + exclusive_usage(); test_func = test_rw; w_flag = 1; break; case 'n': if (w_flag) - usage(); + exclusive_usage(); test_func = test_nd; w_flag = 2; break; -- 1.8.3.1