diff options
author | Robin Hsu <robinhsu@google.com> | 2020-11-11 17:40:57 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-12-07 09:25:14 -0800 |
commit | fcd5cd0b52ea46d0e2fedf7af98b396da23205c6 (patch) | |
tree | 245d50f97de28a4c25dd131dadd89c31151ddfa9 | |
parent | 31d30f0c49b210996dc9bfdf5623b08ff91ccd55 (diff) | |
download | f2fs-tools-fcd5cd0b52ea46d0e2fedf7af98b396da23205c6.tar.gz |
f2fs-tools: skipped to end on error syntax error
When error were found, we won't need to do any initialization but
just quit.
Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/main.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fsck/main.c b/fsck/main.c index 32559f1..e70048b 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -597,20 +597,22 @@ void f2fs_parse_options(int argc, char *argv[]) } } - add_default_options(); + if (err == NOERROR) { + add_default_options(); - if (optind >= argc) { - MSG(0, "\tError: Device not specified\n"); - error_out(prog); - } + if (optind >= argc) { + MSG(0, "\tError: Device not specified\n"); + error_out(prog); + } - c.devices[0].path = strdup(argv[optind]); - if (argc > (optind + 1)) { - c.dbg_lv = 0; - err = EUNKNOWN_ARG; + c.devices[0].path = strdup(argv[optind]); + if (argc > (optind + 1)) { + c.dbg_lv = 0; + err = EUNKNOWN_ARG; + } + if (err == NOERROR) + return; } - if (err == NOERROR) - return; /* print out error */ switch (err) { |