From patchwork Thu Jun 17 08:42:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shevchenko Andriy (EXT-Teleca/Helsinki)" X-Patchwork-Id: 56406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8A2D4B6F11 for ; Tue, 22 Jun 2010 17:18:57 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OQxja-0005u7-OI; Tue, 22 Jun 2010 07:17:26 +0000 Received: from smtp.nokia.com ([192.100.122.233] helo=mgw-mx06.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1OQxjS-0005sa-GR for linux-mtd@lists.infradead.org; Tue, 22 Jun 2010 07:17:22 +0000 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o5M7GBdn030819 for ; Tue, 22 Jun 2010 10:17:12 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 22 Jun 2010 10:16:45 +0300 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 22 Jun 2010 10:16:45 +0300 Received: from fs-test.localnet (esdhcp035224.research.nokia.com [172.21.35.224]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o5M7GiQL012067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Jun 2010 10:16:44 +0300 Resent-From: Andy Shevchenko Resent-To: linux-mtd@lists.infradead.org Resent-Date: Tue, 22 Jun 2010 09:17:35 +0200 Resent-Message-ID: <201006221017.35571.ext-andriy.shevchenko@nokia.com> Received: from esebh102.NOE.Nokia.com (172.21.138.183) by NOK-AM1MHUB-04.mgdnok.nokia.com (65.54.30.8) with Microsoft SMTP Server id 8.2.254.0; Thu, 17 Jun 2010 10:42:53 +0200 Received: from esebh106.NOE.Nokia.com ([172.21.138.213]) by esebh102.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 17 Jun 2010 11:42:45 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 17 Jun 2010 11:42:44 +0300 Received: from fs-test.research.nokia.com (esdhcp036209.research.nokia.com [172.21.36.209]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o5H8ghxZ016962; Thu, 17 Jun 2010 11:42:43 +0300 Received: by fs-test.research.nokia.com (Postfix, from userid 1001) id 3152CD6CE4; Thu, 17 Jun 2010 11:42:41 +0300 (EEST) From: "Shevchenko Andriy (EXT-Teleca/Helsinki)" To: "Bityutskiy Artem (Nokia-D/Helsinki)" Date: Thu, 17 Jun 2010 10:42:37 +0200 Subject: [PATCH 1/3] mkfs.ubifs: check output first Thread-Topic: [PATCH 1/3] mkfs.ubifs: check output first Thread-Index: AcsN+RPKkR8OX0YtTMSOuHAZx/lI+g== Message-ID: <1276764159-28726-1-git-send-email-ext-andriy.shevchenko@nokia.com> Accept-Language: en-US Content-Language: en-US X-MS-Exchange-Organization-AuthAs: Internal X-MS-Exchange-Organization-AuthMechanism: 10 X-MS-Exchange-Organization-AuthSource: nok-am1mhub-04.mgdnok.nokia.com X-MS-Has-Attach: X-MS-Exchange-Organization-SCL: 0 X-MS-TNEF-Correlator: x-originalarrivaltime: 17 Jun 2010 08:42:44.0764 (UTC) FILETIME=[0E456DC0:01CB0DF9] MIME-Version: 1.0 X-Length: 3017 X-UID: 28221 X-Nokia-AV: Clean X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100622_031718_889680_73691E96 X-CRM114-Status: GOOD ( 14.73 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.100.122.233 listed in list.dnswl.org] Cc: "Shevchenko Andriy \(EXT-Teleca/Helsinki\)" X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Andy Shevchenko --- 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 e4b4e3c..9061453 100644 --- a/mkfs.ubifs/mkfs.ubifs.c +++ b/mkfs.ubifs/mkfs.ubifs.c @@ -647,8 +647,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; @@ -656,9 +659,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)");