From patchwork Mon May 14 08:29:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prashant Bhole X-Patchwork-Id: 912748 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lab.ntt.co.jp Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40kv6K5NZFz9ryk for ; Mon, 14 May 2018 18:30:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752098AbeENIar (ORCPT ); Mon, 14 May 2018 04:30:47 -0400 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:53885 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbeENIaq (ORCPT ); Mon, 14 May 2018 04:30:46 -0400 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w4E8UL5K004498; Mon, 14 May 2018 17:30:21 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 42F86EA7FBB; Mon, 14 May 2018 17:30:21 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 3853BEA7F81; Mon, 14 May 2018 17:30:21 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (unknown [129.60.241.220]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 254FA400370; Mon, 14 May 2018 17:30:21 +0900 (JST) From: Prashant Bhole Subject: [PATCH bpf-next v2] samples/bpf: xdp_monitor, accept short options Date: Mon, 14 May 2018 17:29:15 +0900 Message-Id: <20180514082915.3364-1-bhole_prashant_q7@lab.ntt.co.jp> X-Mailer: git-send-email 2.14.2 X-CC-Mail-RelayStamp: 1 To: Daniel Borkmann , Alexei Starovoitov Cc: Prashant Bhole , Jesper Dangaard Brouer , "David S . Miller" , netdev@vger.kernel.org X-TM-AS-MML: disable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Updated optstring parameter for getopt_long() to accept short options. Also updated usage() function. Signed-off-by: Prashant Bhole Acked-by: Jesper Dangaard Brouer --- samples/bpf/xdp_monitor_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/bpf/xdp_monitor_user.c b/samples/bpf/xdp_monitor_user.c index 894bc64c2cac..05ad3f590c91 100644 --- a/samples/bpf/xdp_monitor_user.c +++ b/samples/bpf/xdp_monitor_user.c @@ -58,7 +58,7 @@ static void usage(char *argv[]) printf(" flag (internal value:%d)", *long_options[i].flag); else - printf("(internal short-option: -%c)", + printf("short-option: -%c", long_options[i].val); printf("\n"); } @@ -594,7 +594,7 @@ int main(int argc, char **argv) snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]); /* Parse commands line args */ - while ((opt = getopt_long(argc, argv, "h", + while ((opt = getopt_long(argc, argv, "hDSs:", long_options, &longindex)) != -1) { switch (opt) { case 'D':