From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 3/4] fsck.f2fs: fix wrong usage out
Date: Mon, 13 Feb 2017 18:05:19 -0800 [thread overview]
Message-ID: <20170214020520.18091-3-jaegeuk@kernel.org> (raw)
In-Reply-To: <20170214020520.18091-1-jaegeuk@kernel.org>
This fixes wrong messages for error out.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fsck/main.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/fsck/main.c b/fsck/main.c
index 6c94a70..8bf5cd9 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -88,18 +88,20 @@ static int is_digits(char *optarg)
return i == strlen(optarg);
}
-static void error_out(void)
+static void error_out(char *prog)
{
- if (c.func == FSCK)
+ if (!strcmp("fsck.f2fs", prog))
fsck_usage();
- else if (c.func == DUMP)
+ else if (!strcmp("dump.f2fs", prog))
dump_usage();
- else if (c.func == DEFRAG)
+ else if (!strcmp("defrag.f2fs", prog))
defrag_usage();
- else if (c.func == RESIZE)
+ else if (!strcmp("resize.f2fs", prog))
resize_usage();
- else if (c.func == SLOAD)
+ else if (!strcmp("sload.f2fs", prog))
sload_usage();
+ else
+ MSG(0, "\nWrong progam.\n");
}
void f2fs_parse_options(int argc, char *argv[])
@@ -110,7 +112,7 @@ void f2fs_parse_options(int argc, char *argv[])
if (argc < 2) {
MSG(0, "\tError: Device not specified\n");
- error_out();
+ error_out(prog);
}
c.devices[0].path = strdup(argv[argc - 1]);
argv[argc-- - 1] = 0;
@@ -392,7 +394,7 @@ void f2fs_parse_options(int argc, char *argv[])
MSG(0, "\tError: Unknown argument %s\n", argv[optind]);
break;
}
- error_out();
+ error_out(prog);
}
static void do_fsck(struct f2fs_sb_info *sbi)
--
2.11.0
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
next prev parent reply other threads:[~2017-02-14 2:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 2:05 [PATCH 1/4] mkfs.f2fs: make sure clean all reset dnodes Jaegeuk Kim
2017-02-14 2:05 ` [PATCH 2/4] f2fs-tools: catch up up-to-date checkpoint flag Jaegeuk Kim
2017-02-14 2:05 ` Jaegeuk Kim [this message]
2017-02-14 2:05 ` [PATCH 4/4] mkfs.f2fs: support nat_bits feature Jaegeuk Kim
2017-02-23 9:25 ` [PATCH 1/4] mkfs.f2fs: make sure clean all reset dnodes Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170214020520.18091-3-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).