diff --git a/btrfstune.c b/btrfstune.c index f731e3d2..ac559fb9 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -399,7 +399,6 @@ int main(int argc, char *argv[]) int ret; u64 super_flags = 0; - optind = 1; while(1) { static const struct option long_options[] = { { "help", no_argument, NULL, GETOPT_VAL_HELP}, diff --git a/cmds-balance.c b/cmds-balance.c index 71816736..374e9817 100644 --- a/cmds-balance.c +++ b/cmds-balance.c @@ -522,7 +522,6 @@ static int cmd_balance_start(int argc, char **argv) memset(&args, 0, sizeof(args)); - optind = 1; while (1) { enum { GETOPT_VAL_FULL_BALANCE = 256 }; static const struct option longopts[] = { @@ -785,7 +784,6 @@ static int cmd_balance_status(int argc, char **argv) int verbose = 0; int ret; - optind = 1; while (1) { int opt; static const struct option longopts[] = { diff --git a/cmds-device.c b/cmds-device.c index 1c886ad5..59695feb 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -257,7 +257,6 @@ static int cmd_device_scan(int argc, char **argv) int all = 0; int ret = 0; - optind = 1; while (1) { int c; static const struct option long_options[] = { @@ -392,7 +391,6 @@ static int cmd_device_stats(int argc, char **argv) __u64 flags = 0; DIR *dirstream = NULL; - optind = 1; while ((c = getopt(argc, argv, "z")) != -1) { switch (c) { case 'z': diff --git a/cmds-fi-du.c b/cmds-fi-du.c index 6d5bf351..ec8e550f 100644 --- a/cmds-fi-du.c +++ b/cmds-fi-du.c @@ -543,7 +543,6 @@ int cmd_filesystem_du(int argc, char **argv) unit_mode = get_unit_mode_from_arg(&argc, argv, 1); - optind = 1; while (1) { static const struct option long_options[] = { { "summarize", no_argument, NULL, 's'}, diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c index b26ece1d..04d68b18 100644 --- a/cmds-fi-usage.c +++ b/cmds-fi-usage.c @@ -922,7 +922,6 @@ int cmd_filesystem_usage(int argc, char **argv) unit_mode = get_unit_mode_from_arg(&argc, argv, 1); - optind = 1; while (1) { int c; diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 9392a30b..ef1f550b 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -1041,7 +1041,6 @@ static int cmd_filesystem_defrag(int argc, char **argv) defrag_global_verbose = 0; defrag_global_errors = 0; defrag_global_fancy_ioctl = 0; - optind = 1; while(1) { int c = getopt(argc, argv, "vrc::fs:l:t:"); if (c < 0) diff --git a/cmds-inspect.c b/cmds-inspect.c index 2ae44be2..4b7cea07 100644 --- a/cmds-inspect.c +++ b/cmds-inspect.c @@ -96,7 +96,6 @@ static int cmd_inspect_inode_resolve(int argc, char **argv) int ret; DIR *dirstream = NULL; - optind = 1; while (1) { int c = getopt(argc, argv, "v"); if (c < 0) @@ -151,7 +150,6 @@ static int cmd_inspect_logical_resolve(int argc, char **argv) char *path_ptr; DIR *dirstream = NULL; - optind = 1; while (1) { int c = getopt(argc, argv, "Pvs:"); if (c < 0) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 14418d45..a3bc939a 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -309,7 +309,6 @@ static int cmd_qgroup_show(int argc, char **argv) unit_mode = get_unit_mode_from_arg(&argc, argv, 0); - optind = 1; while (1) { int c; static const struct option long_options[] = { @@ -408,7 +407,6 @@ static int cmd_qgroup_limit(int argc, char **argv) int exclusive = 0; DIR *dirstream = NULL; - optind = 1; while (1) { int c = getopt(argc, argv, "ce"); if (c < 0) diff --git a/cmds-quota.c b/cmds-quota.c index 568482fc..75c032b1 100644 --- a/cmds-quota.c +++ b/cmds-quota.c @@ -120,7 +120,6 @@ static int cmd_quota_rescan(int argc, char **argv) DIR *dirstream = NULL; int wait_for_completion = 0; - optind = 1; while (1) { int c = getopt(argc, argv, "sw"); if (c < 0) diff --git a/cmds-scrub.c b/cmds-scrub.c index 4a1d4751..c03bc5fb 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1141,7 +1141,6 @@ static int scrub_start(int argc, char **argv, int resume) int force = 0; int nothing_to_resume = 0; - optind = 1; while ((c = getopt(argc, argv, "BdqrRc:n:f")) != -1) { switch (c) { case 'B': @@ -1675,7 +1674,6 @@ static int cmd_scrub_status(int argc, char **argv) int err = 0; DIR *dirstream = NULL; - optind = 1; while ((c = getopt(argc, argv, "dR")) != -1) { switch (c) { case 'd': diff --git a/cmds-subvolume.c b/cmds-subvolume.c index e3d2cbce..be2d41ed 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -127,7 +127,6 @@ static int cmd_subvol_create(int argc, char **argv) struct btrfs_qgroup_inherit *inherit = NULL; DIR *dirstream = NULL; - optind = 1; while (1) { int c = getopt(argc, argv, "c:i:v"); if (c < 0) @@ -263,7 +262,6 @@ static int cmd_subvol_delete(int argc, char **argv) int verbose = 0; int commit_mode = 0; - optind = 1; while (1) { int c; static const struct option long_options[] = { @@ -439,7 +437,6 @@ static int cmd_subvol_list(int argc, char **argv) filter_set = btrfs_list_alloc_filter_set(); comparer_set = btrfs_list_alloc_comparer_set(); - optind = 1; while(1) { int c; static const struct option long_options[] = { @@ -616,7 +613,6 @@ static int cmd_subvol_snapshot(int argc, char **argv) struct btrfs_qgroup_inherit *inherit = NULL; DIR *dirstream1 = NULL, *dirstream2 = NULL; - optind = 1; memset(&args, 0, sizeof(args)); while (1) { int c = getopt(argc, argv, "c:i:r"); @@ -1186,7 +1182,6 @@ static int cmd_subvol_sync(int argc, char **argv) int id_count; int sleep_interval = 1; - optind = 1; while (1) { int c = getopt(argc, argv, "s:");