Message ID | 20200208134705.6547-1-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::240; helo=mail-lj1-x240.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=ls8Q0unp; dkim-atps=neutral Received: from mail-lj1-x240.google.com (mail-lj1-x240.google.com [IPv6:2a00:1450:4864:20::240]) (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 48FD4L58KCz9sRK for <incoming@patchwork.ozlabs.org>; Sun, 9 Feb 2020 00:47:14 +1100 (AEDT) Received: by mail-lj1-x240.google.com with SMTP id k25sf700747lji.4 for <incoming@patchwork.ozlabs.org>; Sat, 08 Feb 2020 05:47:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581169632; cv=pass; d=google.com; s=arc-20160816; b=rDRxxQ1OsqJx/itFOhJCv8uhy3UC71crzgyhlh0ENDCVcMJTHIRcTjru6BQ9UAjgju EYjiJlPaV/YcyNgeYwHnEIoIoCbstSbF8OtCB4MRaFFyNzZfV8Eh0EPORsCjIdzNQCK4 8NoWt36tuqR/PDz6wPDVOB1MUxO+afvxFIWASopqy2cY1A4lMFMKqVtrqqxSuBr/50Dq efVevvHb8Lnm+HDqQLtCzxmB4uQSbjuhoqDIzAZZUxF8AuBmYbMDwVfzR3jopi70nHr3 fJPOFUE5eI787PXs9f5KxcRlu2Yjzgh3qk1linKgiaZc6D+wSAIhhet5607ohlHQKrwk xEIg== 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:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=yO0yDA3GjjYtl8hgMjUUUIwDj3J66ODvPPqLfSgaC6w=; b=T2dleCc6I6N13elbFoQLbfDeGbyPeybVYcHiRlYXmPYVXYaa76xudN5HuWsVZogVTh wH39zAPHIbEknOB5bgiAidYb3py1pMFCLEUUNqYDBw05YpMbZGht/sppeblv0ZE2wBXH 5hIJtdW1WpnpL0H329FICEhNtYoKsjtwrTuCFjpyHj/HB9eKtQ8ytKFobVefDqja3XM4 HUM0X6LVhXmmSQGpfbQ41DNTJaNC6VGQGAkgaBJpurBugj+nxq+1rAreHb2+bAcvD9mc TGmqatjtMW0gWuvmeZUjp3chySEB+sS/ufAX7paFVFKJ+pnIr+nUbWnquuoXrVhP9Wxr C/Yw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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: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=yO0yDA3GjjYtl8hgMjUUUIwDj3J66ODvPPqLfSgaC6w=; b=ls8Q0unplp2PXlJh86LkITx4r4yuCGWk1BcKbThdkjZe4qbcMP3vlkskaWDjRCsOKC 69vPe2wSvCSGNcUNwIz6uWNNoh01aEkXB3oIbHhqsoPGGNxOClXioirTKkCn0FksYIT4 WoFtyzaENjiYwM7mFrALSf6HWng/xszY7tCtSrMSWX/aXoRqfHixCvQ3muC0ziqPS1JI g3NDtF/B0GA1y4EmxLw/jeKqYRjlNEP9wGGN8xr0QknkrPZO3rxBrw7Glrhdla9CCMaL sdqDclFBPHpBMgQTa1GZaGDGuj1a/sgkMdfcDIU45985mlQ7OF29uLCxn+Cpu8UehnUR U3sw== 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 :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=yO0yDA3GjjYtl8hgMjUUUIwDj3J66ODvPPqLfSgaC6w=; b=g8nswBlPSnCUmXWKd8HPZEStGAlFY0oHTbvi/Ezbhbj4hbnPxpsQjNqnaIMVi8McWc XQBgC93SVatYwmn2mKHzfyrngrM4Nrjk+N58iqRp05pYE+QUGqdQcqzOwSAadEcEYMba 0fDVY/f7zeld8slYM/rEJ557jU21O6tmIFWOXm7MoFtJRRtPyvlh1IzZQRi1p0PHy2eV MLamN2k1c8CPDy73rr7H2J6uBsnq0lGvW0TqRT7XRyevfGlTTUMOzDam4WaolluDQM7n QjRsVlc9erXVlFjIPjev1nUdt6wmOz/bRS+fOLG2RouYA7jgsWW6ngdtqxZaUNR/gYg9 8Rcw== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAWRC8l4KQjCQ62vJIxxR0lZb6Zar6DmhNZO6awKUHWUgy6W84OB I6BL6VmnBILirwRvxl0/enw= X-Google-Smtp-Source: APXvYqy2RN77LbdhAsiBgdWLtSj94PWnuYQJGW2RasZnGXe/OEL2B9kHUusb3jraKtCXdDJMp9AtNg== X-Received: by 2002:ac2:5f74:: with SMTP id c20mr2062785lfc.15.1581169631906; Sat, 08 Feb 2020 05:47:11 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:9516:: with SMTP id f22ls415766ljh.2.gmail; Sat, 08 Feb 2020 05:47:10 -0800 (PST) X-Received: by 2002:a05:651c:40c:: with SMTP id 12mr2740023lja.147.1581169630909; Sat, 08 Feb 2020 05:47:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581169630; cv=none; d=google.com; s=arc-20160816; b=sUD0PbQ0lRiPfGf1mfKnwuBQxkEspbkr2BTyE4XJ8RoPaaYjEmh3voovRl+1GLklYZ 0OH7c8niLWF2n/dqCcbLlK/SDlqvR/gE3NmrYkQUW5x69YFXiEgFbvayLH0vrvTDRdgd 5f7GfYtOCsy0KcmLB1jJKVzn+naXkU0MzPJ7i0icRz1hbYiKqoqiSgdv5b4aX1vUQpmB WkTDvHYhM+NZYr/jDOuACCmLp7YnBGcxcK2+X+GNXeAGlaKYDHb4YxdgJPkI8+vFxMRd 6gruvWGe0bLwXKXinajmgvbdUBmoqxkjL82g7s8pkskxdtO3ZbMxqTdS78TCN5F1llm0 2kmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=WviH+YcTa5dZMmIQH6+M/7y4ZNUF0IoAuAMh0zSNw9k=; b=C8uYse7UOq/qhXhZOIbnsHiOy0VGPTil08JLfx6t4OsPNiXk680IbWLW7Ezk+WRupb sLSpJYkM8dHE6EgpLvEbHX2SZcMXVDXKDJ2AW7Y6sKJeDk/IlUEyQ398Abt4QjiyriiB wIkvf3VnK0F+BZpDN/fy/cHsVKbLW3YNa4cYW7bGqoelUYyQV9Z+bp5Z4wO5RjyfkzFH 6T6DPSmVlZGcA0I4O0PmSsNEQ9USZAl+hlq35G9WL7/HJgy8w3jXJI1l8s1A/NB151cC Ay4Fl0Sf2fW8KPxyh7cNZlBsice+4DlBtXyK/LYla4tIqpowpM+pJxdwWwW/bGdv/au2 fQHw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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.9]) by gmr-mx.google.com with ESMTPS id h8si135641ljj.3.2020.02.08.05.47.10 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Feb 2020 05:47:10 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48FD4G4799z1qqkS; Sat, 8 Feb 2020 14:47:10 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48FD4G3q6wz1rVvc; Sat, 8 Feb 2020 14:47:10 +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 iawWM7HxPjIS; Sat, 8 Feb 2020 14:47:09 +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:09 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 6A9904540663; 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 WEWcOznKipQi; Sat, 8 Feb 2020 14:47:07 +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 C9ECA45403AC; 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 1/4] server_general: do not raise error in case of unrecognized option Date: Sat, 8 Feb 2020 14:47:02 +0100 Message-Id: <20200208134705.6547-1-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 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.9 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_general.c b/suricatta/server_general.c index 5f91931..f20d433 100644 --- a/suricatta/server_general.c +++ b/suricatta/server_general.c @@ -604,6 +604,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, "u:l:r:w:p:", long_options, NULL)) != -1) { switch (choice) { @@ -626,9 +627,10 @@ 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_general.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)