From: David Sterba Date: Tue, 15 Mar 2016 15:31:58 +0000 (+0100) Subject: btrfs-progs: dump-super: switch to getopt_long X-Git-Tag: upstream/4.16.1~1682 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a54ef26e5158b0f470ccabf330296487c43331c3;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: dump-super: switch to getopt_long Signed-off-by: David Sterba --- diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c index ff7257e..253a68a 100644 --- a/cmds-inspect-dump-super.c +++ b/cmds-inspect-dump-super.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "ctree.h" #include "disk-io.h" @@ -453,7 +454,6 @@ const char * const cmd_inspect_dump_super_usage[] = { int cmd_inspect_dump_super(int argc, char **argv) { - int opt; int all = 0; int full = 0; int force = 0; @@ -464,8 +464,17 @@ int cmd_inspect_dump_super(int argc, char **argv) u64 arg; u64 sb_bytenr = btrfs_sb_offset(0); - while ((opt = getopt(argc, argv, "fFai:s:")) != -1) { - switch (opt) { + while (1) { + int c; + static const struct option long_options[] = { + {NULL, 0, NULL, 0} + }; + + c = getopt_long(argc, argv, "fFai:s:", long_options, NULL); + if (c < 0) + break; + + switch (c) { case 'i': arg = arg_strtou64(optarg); if (arg >= BTRFS_SUPER_MIRROR_MAX) {