summaryrefslogtreecommitdiff
path: root/cmds-device.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-device.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-device.c')
-rw-r--r--cmds-device.c2
1 files changed, 0 insertions, 2 deletions
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':