Message ID | 20200208134705.6547-2-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBX7X7LYQKGQEOFZ72QI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::43c; helo=mail-wr1-x43c.google.com; envelope-from=swupdate+bncbcxploxj6ikrbx7x7lyqkgqeofz72qi@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=YOP/2Brg; dkim-atps=neutral Received: from mail-wr1-x43c.google.com (mail-wr1-x43c.google.com [IPv6:2a00:1450:4864:20::43c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48FD4M2yJBz9sRR for <incoming@patchwork.ozlabs.org>; Sun, 9 Feb 2020 00:47:15 +1100 (AEDT) Received: by mail-wr1-x43c.google.com with SMTP id d8sf1436781wrq.12 for <incoming@patchwork.ozlabs.org>; Sat, 08 Feb 2020 05:47:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581169632; cv=pass; d=google.com; s=arc-20160816; b=c7LvwTVd5p+9Jxwh8d402ha9OvRBEMZsuBh3litopcZzQgz7LbSFgFjqX4A7wYDJKQ 4GJxDfIzgOo+IUtIsewI5hLDYjIXbrLk6qaP6PTmuO6CECsvIv8qv1XTisSH+QPnng1e ySS+5KX1ANCZ6GPZtyeEQ4oh9EEmRUkn6+EYCnLz4XG66K3IkacSiIBaBZAxrMOZFBpm ZMqmbbG3b9t6fdkClpo8a+1VRtU87H9Q6d8inNZeRwTri/UBWk7Zu5z6/+rmUBQwIOEG U2gKsf4kOARPHYuWj9wHDa+cgUz/RrZRATlJo4FfFIX43ITfosFBnvC9tmXuhcwSGOKa g4Xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=loH+EBaeOJrpwBy/+NuOY9Iis/lXA8QFLg07SItkrMQ=; b=isH/oEqdvbTdW7CNDg7gWK0dA1Xysw2HTvFKumZFbZ90NpCHn/b1Jbqz+CISOGzlC8 RMb1Fro8SKSqhnzzB5x2U2/y5R8WjcGn1hmLjGD7sS40INpdP2mOulsrxHiENskAMJE1 53Hmv3imUkEiyFopYsCy3Dzorqq1ZojZwKKnemPoin+ZAYGKO3En6d4QdpPEW3CJyuOp pqj+S+qAsI+U9qW8wDIHYJlXS6pwczTcD28m1J0oDC42o/o0gZInS9Wn+H5qZlZL8gqe axCx1NmTpy8BqnT+0xNfoRYLbKlZA4ADKgz1U5viMv0WsBMTcqvo7xg/iQOnx2lMOTo1 Gtxw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=loH+EBaeOJrpwBy/+NuOY9Iis/lXA8QFLg07SItkrMQ=; b=YOP/2BrglxATDMVt6xSbAS7Cf69m+uaB0Tdk2H7IimGa8jCuiYfFF70RKxo3Opo6Js BXbdnVukpQuDFhbjGqNgrL+/7M7ZPZJY48gXrBgDi2t/gkJGDlsR52aLSzWCKirkxf8/ 0g++eQXGnLtDrwX2j/Yee+Vznh68tNnxtsSSU0tSRkF0Bjx4gepDXJTMF+1c45Hmu/4t 8eOmlHhh9W69Iw7+/k4zROzP2E9K3PqHzG925PLR272EBFswYr9qn9omdDdOfFkw33pX MAFim8qkGL34vJhymCNAspooRCMi73HmfMawXvVqIctR8MJS3O+lCW3hpnMvS82uiIRU cp0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=loH+EBaeOJrpwBy/+NuOY9Iis/lXA8QFLg07SItkrMQ=; b=llHXJnADolOiIkuPiqHyfQ8/RsjFR3wTYQeNuMc6nllh5nPDUJxLehqWnFQy5G6nLn ec5etnVvEub3Nssi7O2Ha5jFMH/Hl/3kZlVLLnYvKbRMDwFjPSMIIQjXPydl39UgeHzC uKclvvPAkp2dExpBvIxCg6XV67rqWkARhvCTqnLjHg21BMK6cDRWG1ViLr/XInssZdQU x1Pv0kGINGkvUDISTPCjwfq3StRFTTT53ofS5UyA5iRSZggnhjyjE0+4ATCLxqQor5xK ePXKz6vohW6LqVmkZnro84bb/pqzSaEbdp73r6DzoIN808+Zc2ZzAC7+Jl/X4jB9nC4F d3Rg== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAUslSC+OFULEPEHv6BFCEs1eD8zAjycNxotYv/KpP55KH7w6kz1 k2SXqbYE63DJ4+TDjGsMoCk= X-Google-Smtp-Source: APXvYqwxwscK5P5TFiIWLiOilYdMn+Bez4tlzzIaacSEarlIfbS4OHnjKcU6wWIhGdfM5jxeeqofjg== X-Received: by 2002:a05:6000:108e:: with SMTP id y14mr5632952wrw.338.1581169632250; Sat, 08 Feb 2020 05:47:12 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a7b:c452:: with SMTP id l18ls10313392wmi.1.canary-gmail; Sat, 08 Feb 2020 05:47:11 -0800 (PST) X-Received: by 2002:a1c:7c18:: with SMTP id x24mr4788339wmc.185.1581169631444; Sat, 08 Feb 2020 05:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581169631; cv=none; d=google.com; s=arc-20160816; b=SDfrCOo37SXlClq5dM5/QFBil7j9raD0GitPTxXWQcouBXpitGOrDj4xEu35heH0pi IER2sRMRzCJ3kFjf7tckBuc3FX22O3TBxLzTo42+8kObVKZva0pz4a6P1rSXjNW9cAWo ornloUPoijEP3yITshY6X8Pz1kSqqh7c4r9XkWVvHyELd2ZdXPTruiFCkqSDNI87MYr3 6N/cd3UWb9adiHUfhjixXnGgW17iymLbXApnQxekku1KdZHzTP570mLe13rll8xLorao 6QuKngpzP+d82GH78eL/jLuENYWNJsOE5bWhKWI8aW5nLaYtPp8lr7z9PIjqyhOzRBuw R8GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=31x/7iP5dj8nxFKiEmJCbBmKVDg1MZ2lSDeacbB+Rf0=; b=IxpeVqZECqKqmtG/Jkpejdiq22DP+taqjbFVA2X8LJA1sTK7qNwTNlsZHzWXDZZKKW OXhkYET/TOPU+8Jz8jmDEvnxlvh431jqI8tUmGJFaHamZqJl6oCwtS8Oqxgn95CvoH53 3CGUpigxmGgsW2ySmUlBt3Dt3cn+3NE4/qDjK8TlMPfORERC5bchzyxarvPm8fi2mUXR 1PpUjjiUSJtoWO+N5u35kKvdaXoWda7aICvFpfd2OBJ6w49fnygXEiGh2DgLfN8vZs7k Jttqb5IFQcOVZ0X6CSKJ1HaqRQMuJEYPTbzNiTtpYdpWH3thlBUPo3am8arTCW1mELAd dNiw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id y185si634713wmg.0.2020.02.08.05.47.11 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Feb 2020 05:47:11 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48FD4H1dtRz1rW6N; Sat, 8 Feb 2020 14:47:11 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48FD4H1Vvvz1rVvc; Sat, 8 Feb 2020 14:47:11 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id ygaaW3nBJYZP; Sat, 8 Feb 2020 14:47:10 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sat, 8 Feb 2020 14:47:10 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id F3A0745403AC; Sat, 8 Feb 2020 14:47:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id qjmo5ZFVsNas; Sat, 8 Feb 2020 14:47:08 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [IPv6:2001:a61:60cb:9d01:4102:a8ec:5d26:4c4b]) by babic.homelinux.org (Postfix) with ESMTP id F064145404F9; Sat, 8 Feb 2020 14:47:07 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH 2/4] server_hawkbit: do not raise error in case of unrecognized option Date: Sat, 8 Feb 2020 14:47:03 +0100 Message-Id: <20200208134705.6547-2-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200208134705.6547-1-sbabic@denx.de> References: <20200208134705.6547-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/4] server_general: do not raise error in case of unrecognized option
|
expand
|
diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 55aa419..65edb8e 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -1519,6 +1519,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) /* reset to optind=1 to parse suricatta's argument vector */ optind = 1; + opterr = 0; while ((choice = getopt_long(argc, argv, "t:i:c:u:p:xr:y::w:k:g:", long_options, NULL)) != -1) { switch (choice) { @@ -1595,9 +1596,9 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) channel_data_defaults.retry_sleep = (unsigned int)strtoul(optarg, NULL, 10); break; + /* Ignore not recognized options, they can be already parsed by the caller */ case '?': - default: - return SERVER_EINIT; + break; } }
This allows to have a two-stage parsing of the command line parameters with general parameters parsed by the suricatta module. Each stage cannot raise an error because it is not responsible for all parameters, but just for a part of them. Signed-off-by: Stefano Babic <sbabic@denx.de> --- suricatta/server_hawkbit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)