From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
To: linux-mtd@lists.infradead.org,
"Bityutskiy Artem (Nokia-MS/Helsinki)"
<Artem.Bityutskiy@nokia.com>
Cc: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Subject: [PATCH] mkfs.ubifs: check output first
Date: Mon, 4 Apr 2011 11:21:15 +0300 [thread overview]
Message-ID: <1301905275-2087-1-git-send-email-ext-andriy.shevchenko@nokia.com> (raw)
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
---
mkfs.ubifs/mkfs.ubifs.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index bc0817f..9f3c5e0 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)");
--
1.6.3.3
next reply other threads:[~2011-04-04 8:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 8:21 Andy Shevchenko [this message]
2011-04-04 8:23 ` [PATCH] mkfs.ubifs: check output first Artem Bityutskiy
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=1301905275-2087-1-git-send-email-ext-andriy.shevchenko@nokia.com \
--to=ext-andriy.shevchenko@nokia.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=linux-mtd@lists.infradead.org \
/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