Skip to content

Commit

Permalink
samples/bpf: xdp_monitor, accept short options
Browse files Browse the repository at this point in the history
Updated optstring parameter for getopt_long() to accept short options.
Also updated usage() function.

Signed-off-by: Prashant Bhole <[email protected]>
Acked-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
  • Loading branch information
pbhole authored and borkmann committed May 14, 2018
1 parent 1772be3 commit 53ea24c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/bpf/xdp_monitor_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 53ea24c

Please sign in to comment.