Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4714184ybb; Tue, 7 Apr 2020 12:58:22 -0700 (PDT) X-Google-Smtp-Source: APiQypLBogpMYdQL3nunGIvi3VFTulxOG5evrs4Tj70p4VJQOd4cgXuGLKLrF4x1J+RvJSb6Ruph X-Received: by 2002:aca:c6d1:: with SMTP id w200mr407645oif.43.1586289502615; Tue, 07 Apr 2020 12:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586289502; cv=none; d=google.com; s=arc-20160816; b=LUTuS8ODTGB+CzX5E6+pjEy9Cq7Ya77+cAaBeI7f4bVZWoYQmU7qINsuYCf0vr6lcp hEhdryoKq7FmrNHBK+0nHmjg1nBBqJ3O7Itd7GgxnKYtH75ujCJxSLJQ4IBEJAUxxlq8 cVFUEjhT+2yzCInwx7tcDHW3Ms6SeO75kzzRFk0O6cojqx5nYhJ1y/sIa46L1ASHW1GG xXzaN7YsG5AIfKrk2apjdG0rrMZzBsT9xP8U0WKZmpYRiEHH2xsg8YY7DGiasLPDYor6 K5GuP6n6YBZZAN4PEqOMAL3L9XMlOuthi5EzTI6xwRbVd3VxM9EUxu9iyfK3TI0723tr vNYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=2es5vWloVNzvyZAcHjRw/f+LxsXKzXnOtl1Qg/pl+3k=; b=mLGJZUi/stL2px2CQvnpREYUz35ZMhUL/j4W/nRqPqPuG34NvHTT7iehxaT6Y+0ZvV e28DLCfKXFt3f4jZsfjtfN/fJ/98IeZpSrUteo4X9enFk4Jwjfr+wlF7VJlQG+qj/PYm G3Svsax3R+qPD22sNcbFpkfQUlG/nm1gMUtrrgQquyt4gpFFKLmwiXF2NZ7QBCS05FiV N2Trvy2CbbSDcXv5dmWR4FbvMxXBrzf0U/RCatMEMzCQQ1XpmCLFC1LDu1AaClNKYFTS Mr0VjTbBWkbns2og0U3bHxOXWD9p95qc4UuREasrx1YHssH62phcjUXx7wE2VKrQgIjw TWPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a190si1084189oib.146.2020.04.07.12.58.07; Tue, 07 Apr 2020 12:58:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbgDGT4w (ORCPT + 99 others); Tue, 7 Apr 2020 15:56:52 -0400 Received: from 18.mo5.mail-out.ovh.net ([178.33.45.10]:45934 "EHLO 18.mo5.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726884AbgDGT4w (ORCPT ); Tue, 7 Apr 2020 15:56:52 -0400 X-Greylist: delayed 82854 seconds by postgrey-1.27 at vger.kernel.org; Tue, 07 Apr 2020 15:56:51 EDT Received: from player159.ha.ovh.net (unknown [10.108.57.245]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id 563D427810F for ; Tue, 7 Apr 2020 21:41:06 +0200 (CEST) Received: from labapart.com (mue-88-130-59-209.dsl.tropolys.de [88.130.59.209]) (Authenticated sender: olivier@labapart.com) by player159.ha.ovh.net (Postfix) with ESMTPSA id B99891130FCBE; Tue, 7 Apr 2020 19:41:04 +0000 (UTC) From: Olivier Martin To: linux-bluetooth@vger.kernel.org Cc: Olivier Martin Subject: [PATCH BlueZ v2] emulator: Fix command line parameters with optional argument Date: Tue, 7 Apr 2020 21:40:59 +0200 Message-Id: <20200407194059.5734-1-olivier@labapart.com> X-Mailer: git-send-email 2.17.1 X-Ovh-Tracer-Id: 15515463669956177484 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedrudehgddufeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkofestddtredtredttdenucfhrhhomhepqfhlihhvihgvrhcuofgrrhhtihhnuceoohhlihhvihgvrheslhgrsggrphgrrhhtrdgtohhmqeenucfkpheptddrtddrtddrtddpkeekrddufedtrdehledrvddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhduheelrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepohhlihhvihgvrheslhgrsggrphgrrhhtrdgtohhmpdhrtghpthhtoheplhhinhhugidqsghluhgvthhoohhthhesvhhgvghrrdhkvghrnhgvlhdrohhrgh Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Some parameters were missing the indication that additional argument could be expected. --- btio/btio.c | 8 ++++++-- emulator/main.c | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/btio/btio.c b/btio/btio.c index e7b4db16b..56c59f84e 100644 --- a/btio/btio.c +++ b/btio/btio.c @@ -1676,12 +1676,16 @@ GIOChannel *bt_io_connect(BtIOConnect connect, gpointer user_data, ret = parse_set_opts(&opts, gerr, opt1, args); va_end(args); - if (ret == FALSE) + if (ret == FALSE) { + fprintf(stderr, "bt_io_connect(type:%d) err1\n", opts.type); return NULL; + } io = create_io(FALSE, &opts, gerr); - if (io == NULL) + if (io == NULL) { + fprintf(stderr, "bt_io_connect(type:%d) err2\n", opts.type); return NULL; + } sock = g_io_channel_unix_get_fd(io); diff --git a/emulator/main.c b/emulator/main.c index 68c53488e..75cb79c7b 100644 --- a/emulator/main.c +++ b/emulator/main.c @@ -56,10 +56,12 @@ static void usage(void) printf("options:\n" "\t-S Create local serial port\n" "\t-s Create local server sockets\n" - "\t-l [num] Number of local controllers\n" + "\t-l[num] Number of local controllers\n" "\t-L Create LE only controller\n" + "\t-U[num] Number of test LE controllers\n" "\t-B Create BR/EDR only controller\n" "\t-A Create AMP controller\n" + "\t-T[num] Number of test AMP controllers\n" "\t-h, --help Show help options\n"); } @@ -97,7 +99,7 @@ int main(int argc, char *argv[]) for (;;) { int opt; - opt = getopt_long(argc, argv, "Ssl::LBAUTvh", + opt = getopt_long(argc, argv, "Ssl::LBAU::T::vh", main_options, NULL); if (opt < 0) break; -- 2.17.1