From patchwork Mon Jun 12 10:50:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 774522 X-Patchwork-Delegate: david.oberhollenzer@sigma-star.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wmV9q4rq5z9s72 for ; Mon, 12 Jun 2017 20:53:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Dx9g7QTi"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=lS/52XX7IkpfTjVLByh/r+W0fKjnsAm51DW1Ut2u9X4=; b=Dx9g7QTiK+a0zsTkKHRoKaMxk4 yze9YxqW5ve/iynOC7kDAY4bGzrEA7XD1et4I7fin/4WFobmBxfKoRSB0wtMdsoDYHyokK67H1fdy d0IxijIk7b+4RPSuNTZ95lwGIT/VVPRlsKsRTwxYp9uMjmOTFX3jqaUMgdOZEOwGZetGt9VJSK5uQ zL0krMaq5sekd0Fm5dN27JO2IUHPkR8YCs/daMhU434SU+yGO5tvZMPEslFqulAR7UGdv3C/J3Syc etByN9wS1EJHgxDgVXbygCisnbaNhQpyJecrZbk2zrm/9zFUudcErgyjFdDR22Nw/hshUrXC5+/NE BbdpIJAQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dKMyB-0005an-R0; Mon, 12 Jun 2017 10:53:15 +0000 Received: from thoth.sbs.de ([192.35.17.2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKMwY-0003Jy-Qh for linux-mtd@lists.infradead.org; Mon, 12 Jun 2017 10:51:40 +0000 Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v5CAp7LC004083 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 12 Jun 2017 12:51:08 +0200 Received: from localhost ([139.25.0.78]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id v5CAp76t002911; Mon, 12 Jun 2017 12:51:07 +0200 From: Daniel Wagner To: linux-mtd@lists.infradead.org Subject: [PATCH v0 03/20] mkfs.jffs2: Return error code if command line option is unknown Date: Mon, 12 Jun 2017 12:50:44 +0200 Message-Id: <20170612105101.18223-4-daniel.wagner@siemens.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170612105101.18223-1-daniel.wagner@siemens.com> References: <20170612105101.18223-1-daniel.wagner@siemens.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170612_035135_237430_E7A7C7CD X-CRM114-Status: UNSURE ( 7.30 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.35.17.2 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.35.17.2 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Wagner MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The tool will quit with an exit code 0 if the command line option was not recognized. By returning an error code a calling script has the possibility to distinguish between a real success and an invalid invocation. Signed-off-by: Daniel Wagner --- jffsX-utils/mkfs.jffs2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c index ca5e0d560f98..c77f19005b3e 100644 --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c @@ -1629,9 +1629,11 @@ int main(int argc, char **argv) break; case 'h': - case '?': puts(helptext); exit(EXIT_SUCCESS); + case '?': + puts(helptext); + exit(EXIT_FAILURE); case 'v': verbose = 1;