summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-07-13 19:41:55 +0200
committerDavid Sterba <dsterba@suse.com>2016-07-13 19:41:55 +0200
commitf551548372efa9a22a34e4f1b74fa794d304e6f5 (patch)
tree7c31ab7f1819e84ac62dc17bb3b00d6cea5a463c /cmds-subvolume.c
parent83dc05b013ce08d68a4a3cdcf17e6c5506a8383e (diff)
btrfs-progs: do not set optind if not necessary
In the subcommand callbacks that are called just once, we don't need to explicitly reset optind. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index e3d2cbc..be2d41e 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:");