aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-filesystem.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-filesystem.c
parent39b3d7c77a551b7c6b2063789797fceeae22b346 (diff)
downloadbtrfs-progs-4074ae5f2bac71889527e817ddeee5fd85a3ba59.tar.gz
btrfs-progs-4074ae5f2bac71889527e817ddeee5fd85a3ba59.tar.xz
btrfs-progs-4074ae5f2bac71889527e817ddeee5fd85a3ba59.zip
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-filesystem.c')
-rw-r--r--cmds-filesystem.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index f3fc160..188dbf0 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -208,7 +208,7 @@ static int cmd_filesystem_df(int argc, char **argv)
unsigned unit_mode = UNITS_DEFAULT;
while (1) {
- int long_index;
+ int c;
static const struct option long_options[] = {
{ "raw", no_argument, NULL, 'b'},
{ "kbytes", no_argument, NULL, 'k'},
@@ -221,8 +221,8 @@ static int cmd_filesystem_df(int argc, char **argv)
GETOPT_VAL_HUMAN_READABLE},
{ NULL, 0, NULL, 0 }
};
- int c = getopt_long(argc, argv, "bhHkmgt", long_options,
- &long_index);
+
+ c = getopt_long(argc, argv, "bhHkmgt", long_options, NULL);
if (c < 0)
break;
switch (c) {
@@ -836,14 +836,14 @@ static int cmd_show(int argc, char **argv)
int found = 0;
while (1) {
- int long_index;
+ int c;
static const struct option long_options[] = {
{ "all-devices", no_argument, NULL, 'd'},
{ "mounted", no_argument, NULL, 'm'},
{ NULL, 0, NULL, 0 }
};
- int c = getopt_long(argc, argv, "dm", long_options,
- &long_index);
+
+ c = getopt_long(argc, argv, "dm", long_options, NULL);
if (c < 0)
break;
switch (c) {