X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=init.c;h=c44fa671aa9a3851da57270dd4b901ec272223be;hb=90777558f2b5d38491d6975673ff222c90b092bf;hp=aba7671c1402ff953dc5549e5303b0b9954c2193;hpb=8d916c942bb088204ab5c0438c297903c9160698;p=fio.git diff --git a/init.c b/init.c index aba7671c..c44fa671 100644 --- a/init.c +++ b/init.c @@ -701,6 +701,7 @@ static void td_fill_rand_seeds_os(struct thread_data *td) td->rand_seeds[FIO_RAND_BLOCK_OFF] = FIO_RANDSEED * td->thread_number; os_random_seed(td->rand_seeds[FIO_RAND_BLOCK_OFF], &td->random_state); + os_random_seed(td->rand_seeds[FIO_RAND_SEQ_RAND_OFF], &td->seq_rand_state); } static void td_fill_rand_seeds_internal(struct thread_data *td) @@ -722,6 +723,7 @@ static void td_fill_rand_seeds_internal(struct thread_data *td) td->rand_seeds[FIO_RAND_BLOCK_OFF] = FIO_RANDSEED * td->thread_number; init_rand_seed(&td->__random_state, td->rand_seeds[FIO_RAND_BLOCK_OFF]); + init_rand_seed(&td->__seq_rand_state, td->rand_seeds[FIO_RAND_SEQ_RAND_OFF]); } void td_fill_rand_seeds(struct thread_data *td) @@ -1723,9 +1725,20 @@ 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 (ret) + 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); + td = NULL; + } do_exit++; + } if (!ret && !strcmp(opt, "ioengine")) { free_ioengine(td); @@ -1831,10 +1844,8 @@ int parse_cmd_line(int argc, char *argv[], int client_type) break; } - if (do_exit) { - if (exit_val && !(is_backend || nr_clients)) - exit(exit_val); - } + if (do_exit && !(is_backend || nr_clients)) + exit(exit_val); if (nr_clients && fio_clients_connect()) { do_exit++;