summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-08-24 08:44:26 +0200
committerJens Axboe <axboe@suse.de>2006-08-24 08:44:26 +0200
commit774a617767830b5023f6cad4a45609a92ec82d41 (patch)
tree9c790b3de5f40b02e978f9036ad3590854710bb7
parent40718e3ed151411d9979b9b1c06fd76e5726eae8 (diff)
downloadfio-774a617767830b5023f6cad4a45609a92ec82d41.tar.gz
fio-774a617767830b5023f6cad4a45609a92ec82d41.tar.bz2
[PATCH] Correct command line parsingfio-1.6
It worked if you used -t10, but not -t 10. Correct the idx++ usage to just match optind instead, then things just work. Problem reported by "Randy.Dunlap" <rdunlap@xenotime.net>
-rw-r--r--init.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/init.c b/init.c
index 8d15594d..c1e26d3f 100644
--- a/init.c
+++ b/init.c
@@ -1036,15 +1036,15 @@ static int parse_cmd_line(int argc, char *argv[])
switch (c) {
case 't':
def_timeout = atoi(optarg);
- idx++;
+ idx = optind;
break;
case 'l':
write_lat_log = 1;
- idx++;
+ idx = optind;
break;
case 'w':
write_bw_log = 1;
- idx++;
+ idx = optind;
break;
case 'o':
f_out = fopen(optarg, "w+");
@@ -1053,11 +1053,11 @@ static int parse_cmd_line(int argc, char *argv[])
exit(1);
}
f_err = f_out;
- idx++;
+ idx = optind;
break;
case 'm':
terse_output = 1;
- idx++;
+ idx = optind;
break;
case 'h':
usage(argv[0]);
@@ -1074,7 +1074,7 @@ static int parse_cmd_line(int argc, char *argv[])
ini_file[ini_idx - 1] = strdup(argv[idx]);
idx++;
}
-
+
if (!f_out) {
f_out = stdout;
f_err = stderr;