summaryrefslogtreecommitdiff
path: root/cmds-balance.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-04-08 17:33:55 +0200
committerDavid Sterba <dsterba@suse.cz>2015-04-08 17:33:55 +0200
commit4074ae5f2bac71889527e817ddeee5fd85a3ba59 (patch)
tree18c6b62da30f57218777a5003356edf51a39fffb /cmds-balance.c
parent39b3d7c77a551b7c6b2063789797fceeae22b346 (diff)
btrfs-progs: cleanup option index argument from getopt_long
We're not using it anywhere. The best practice is to add enums with values > 255 for the long options, option index counting is error prone. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-balance.c')
-rw-r--r--cmds-balance.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmds-balance.c b/cmds-balance.c
index 367ab554..92a15335 100644
--- a/cmds-balance.c
+++ b/cmds-balance.c
@@ -389,7 +389,6 @@ static int cmd_balance_start(int argc, char **argv)
optind = 1;
while (1) {
- int longindex;
static const struct option longopts[] = {
{ "data", optional_argument, NULL, 'd'},
{ "metadata", optional_argument, NULL, 'm' },
@@ -399,8 +398,7 @@ static int cmd_balance_start(int argc, char **argv)
{ NULL, 0, NULL, 0 }
};
- int opt = getopt_long(argc, argv, "d::s::m::fv", longopts,
- &longindex);
+ int opt = getopt_long(argc, argv, "d::s::m::fv", longopts, NULL);
if (opt < 0)
break;
@@ -661,13 +659,13 @@ static int cmd_balance_status(int argc, char **argv)
optind = 1;
while (1) {
- int longindex;
+ int opt;
static const struct option longopts[] = {
{ "verbose", no_argument, NULL, 'v' },
{ NULL, 0, NULL, 0 }
};
- int opt = getopt_long(argc, argv, "v", longopts, &longindex);
+ opt = getopt_long(argc, argv, "v", longopts, NULL);
if (opt < 0)
break;