Message ID | 20170612105101.18223-19-daniel.wagner@siemens.com |
---|---|
State | Accepted |
Delegated to: | David Oberhollenzer |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> 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 3wmVKY19Ntz9s4s for <incoming@patchwork.ozlabs.org>; Mon, 12 Jun 2017 21:00:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hogXye5q"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="mt1PAToR"; 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=uqPb+iF3HpsP2jwORQcGBgsdJpksOtNctwDcllUaJEg=; b=hogXye5qUeh0WhOYpB/mG9ysez x0lPFbeEg918OxE+YUhjrW5qNPmQ9XaG7VF6Jq9OSf3Qs0BuVQXxoHxLDZf102AwYUSrJHQxsVwO/ oYT+fRp5QpvGNR70jngYWia8oZiOGUypXp/GKi8UGxoNLI/xDkCfGrtTIDbcJf+1fpX8TFDd9EBth 2aUqsTjDkoKOQUCfpm8qi/+SkXpJ77Qyinvgf5b8n+JykDE7vP9EjGWfO2N0DogCXI7qhPKK7LOBX Tx+nrXU0JRpc3u1pLgA8cBWxWQ7M7btOtKp/wtjt4w1u0L5cL9cb1rnAskDU1A4RtpXVDOPGJov5q mdQkPJvA==; 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 1dKN4c-0001Uq-0h; Mon, 12 Jun 2017 10:59:54 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKN47-0000la-4b for linux-mtd@bombadil.infradead.org; Mon, 12 Jun 2017 10:59:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MQymLXFRC3D3M0daHJpoUudm+0FGIBQsJQR1v0y0+04=; b=mt1PAToROIVS8m0LXtc8FY1s6 oEgOFytxEmtWbAXTJ2XGBbgPSQ2WyH4WifGTvbujx65t2GheHml2a6ymwihqQ8VOB0CR1aou1Fe0A L1R//x5zdFpoqx915fVahH3PcgYYaCNz32GOeyynLhtCN6Sib9Wsg1RBr+m1FeUBZ6swRkT9HI7s3 gpm/rxQpYxrOKWv4UzSGRKurnD8ZIN3Mmysjgj0WPIQCT1XQOUB2dxxuoaYf48VHNtKbMvGjXFQ7T +CBra6oEWh6LZ95GuRQJf/0ENXuevoSqbDNpTQfgU2wpjDdQrLw706aRw5yQbVVjimpir5nRtxKoV 0mF3CpIbg==; Received: from lizzard.sbs.de ([194.138.37.39]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKMwV-0000sl-Gr for linux-mtd@lists.infradead.org; Mon, 12 Jun 2017 10:51:34 +0000 Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id v5CAp9qX020048 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <linux-mtd@lists.infradead.org>; Mon, 12 Jun 2017 12:51:09 +0200 Received: from localhost ([139.25.0.78]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id v5CAp9ss023973; Mon, 12 Jun 2017 12:51:09 +0200 From: Daniel Wagner <daniel.wagner@siemens.com> To: linux-mtd@lists.infradead.org Subject: [PATCH v0 18/20] ubi-utils: ubirsvol: Return error code if command line option is unknown Date: Mon, 12 Jun 2017 12:50:59 +0200 Message-Id: <20170612105101.18223-19-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_115131_655271_1073A770 X-CRM114-Status: UNSURE ( 8.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-6.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [194.138.37.39 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [194.138.37.39 listed in list.dnswl.org] -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 <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Cc: Daniel Wagner <daniel.wagner@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
diff --git a/ubi-utils/ubirsvol.c b/ubi-utils/ubirsvol.c index 69a4ea14ff8d..0854abc53947 100644 --- a/ubi-utils/ubirsvol.c +++ b/ubi-utils/ubirsvol.c @@ -137,12 +137,17 @@ static int parse_opt(int argc, char * const argv[]) break; case 'h': - case '?': printf("%s\n\n", doc); printf("%s\n\n", usage); printf("%s\n", optionsstr); exit(EXIT_SUCCESS); + case '?': + printf("%s\n\n", doc); + printf("%s\n\n", usage); + printf("%s\n", optionsstr); + return -1; + case 'V': common_print_version(); exit(EXIT_SUCCESS);
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. We need to return -1 instead of EXIT_FAILURE to be consistent with the other exit code places. Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com> --- ubi-utils/ubirsvol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)