From 4074ae5f2bac71889527e817ddeee5fd85a3ba59 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 8 Apr 2015 17:33:55 +0200 Subject: 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 --- cmds-balance.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cmds-balance.c') diff --git a/cmds-balance.c b/cmds-balance.c index 367ab55..92a1533 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; -- cgit v1.2.1