projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfb3ea2
)
Better catch arguments with required options and none passed
author
Jens Axboe
<axboe@kernel.dk>
Thu, 23 May 2013 18:00:35 +0000
(20:00 +0200)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 23 May 2013 18:00:35 +0000
(20:00 +0200)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c
patch
|
blob
|
blame
|
history
diff --git
a/init.c
b/init.c
index 0cc6a520b15269c177ff1fa7ab01a4fddc2ac038..e9e5096a5e3d2957ccfc505f3c80ad8e108e1ae1 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-1725,7
+1725,13
@@
int parse_cmd_line(int argc, char *argv[], int client_type)
fio_options_set_ioengine_opts(l_opts, td);
}
- ret = fio_cmd_option_parse(td, opt, val);
+ if ((!val || !strlen(val)) &&
+ l_opts[lidx].has_arg == required_argument) {
+ log_err("fio: option %s requires an argument\n", opt);
+ ret = 1;
+ } else
+ ret = fio_cmd_option_parse(td, opt, val);
+
if (ret) {
if (td) {
put_job(td);