More random fixes
[fio.git] / init.c
diff --git a/init.c b/init.c
index 1a0f7385dfcbe5fe994ba8757f8e22b254b92ed4..92c5b8cda9bc157b4887508e370c76b18f5cc4fe 100644 (file)
--- a/init.c
+++ b/init.c
@@ -811,6 +811,7 @@ struct debug_level debug_levels[] = {
        { .name = "mem",        .shift = FD_MEM, },
        { .name = "blktrace",   .shift = FD_BLKTRACE },
        { .name = "verify",     .shift = FD_VERIFY },
+       { .name = "random",     .shift = FD_RANDOM },
        { },
 };
 
@@ -863,7 +864,7 @@ static void set_debug(const char *string)
 static int parse_cmd_line(int argc, char *argv[])
 {
        struct thread_data *td = NULL;
-       int c, ini_idx = 0, lidx, ret, dont_add_job = 0, bad_options = 0;
+       int c, ini_idx = 0, lidx, ret = 0, bad_options = 0;
 
        while ((c = getopt_long_only(argc, argv, "", long_options, &lidx)) != -1) {
                switch (c) {
@@ -948,8 +949,6 @@ static int parse_cmd_line(int argc, char *argv[])
                        }
 
                        ret = fio_cmd_option_parse(td, opt, val);
-                       if (ret)
-                               dont_add_job = 1;
                        break;
                }
                default:
@@ -962,13 +961,10 @@ static int parse_cmd_line(int argc, char *argv[])
                exit(1);
 
        if (td) {
-               if (dont_add_job)
-                       put_job(td);
-               else {
+               if (!ret)
                        ret = add_job(td, td->o.name ?: "fio", 0);
-                       if (ret)
-                               put_job(td);
-               }
+               if (ret)
+                       put_job(td);
        }
 
        while (optind < argc) {