summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>2011-04-04 11:21:15 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-04 11:27:58 +0300
commit1a48432ba8ae05af773e4a4cc006c8a611fbee8f (patch)
tree54c11c772f8eee00e0595f3fb0e62c8ed6057503
parentb22f7f386ba37a766aedd8e8cf34781a3d1daad2 (diff)
mkfs.ubifs: check output first
Artem: this is jut a clean-up, no functional changes. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--mkfs.ubifs/mkfs.ubifs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index e49a980..a306dd6 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -675,8 +675,11 @@ static int get_options(int argc, char**argv)
if (optind != argc && !output)
output = strdup(argv[optind]);
- if (output)
- out_ubi = !open_ubi(output);
+
+ if (!output)
+ return err_msg("not output device or file specified");
+
+ out_ubi = !open_ubi(output);
if (out_ubi) {
c->min_io_size = c->di.min_io_size;
@@ -684,9 +687,6 @@ static int get_options(int argc, char**argv)
c->max_leb_cnt = c->vi.rsvd_lebs;
}
- if (!output)
- return err_msg("not output device or file specified");
-
if (c->min_io_size == -1)
return err_msg("min. I/O unit was not specified "
"(use -h for help)");