Fix return value of make_filename() when no filename_format
[fio.git] / init.c
diff --git a/init.c b/init.c
index b4b09743f1c94225f48a5566462be84ddb27c810..6af6c450fb6c3f98bfdee648344ae9dc69923ed1 100644 (file)
--- a/init.c
+++ b/init.c
@@ -459,6 +459,7 @@ static struct thread_data *get_new_job(bool global, struct thread_data *parent,
                copy_opt_list(td, parent);
 
        td->io_ops = NULL;
+       td->io_ops_init = 0;
        if (!preserve_eo)
                td->eo = NULL;
 
@@ -1120,7 +1121,7 @@ static char *make_filename(char *buf, size_t buf_size,struct thread_options *o,
 
        if (!o->filename_format || !strlen(o->filename_format)) {
                sprintf(buf, "%s.%d.%d", jobname, jobnum, filenum);
-               return NULL;
+               return buf;
        }
 
        for (f = &fpre_keywords[0]; f->keyword; f++)