Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

samples/bpf: xdp_monitor, accept short options

Updated optstring parameter for getopt_long() to accept short options.
Also updated usage() function.

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

authored by

Prashant Bhole and committed by
Daniel Borkmann
53ea24c2 1772be37

+2 -2
+2 -2
samples/bpf/xdp_monitor_user.c
··· 58 58 printf(" flag (internal value:%d)", 59 59 *long_options[i].flag); 60 60 else 61 - printf("(internal short-option: -%c)", 61 + printf("short-option: -%c", 62 62 long_options[i].val); 63 63 printf("\n"); 64 64 } ··· 594 594 snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]); 595 595 596 596 /* Parse commands line args */ 597 - while ((opt = getopt_long(argc, argv, "h", 597 + while ((opt = getopt_long(argc, argv, "hDSs:", 598 598 long_options, &longindex)) != -1) { 599 599 switch (opt) { 600 600 case 'D':