X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=e88ff9b178a56de8d95285d5251225134dc20d0e;hp=eee23359afc68d209366d7f95cb1c5242de111bf;hb=01ef57cef61251bdc9941404f853a89326917e25;hpb=1907dbc6c0c9e1b663156e64c64c172aaf04ae8a diff --git a/init.c b/init.c index eee23359..e88ff9b1 100644 --- a/init.c +++ b/init.c @@ -804,6 +804,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) int numjobs, i; struct fio_file *f; const char *engine; + int fn_given; /* * the def_thread is just for options, it's not a real job @@ -826,6 +827,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) if (td->odirect) td->io_ops->flags |= FIO_RAWIO; + fn_given = (int) td->filename; if (!td->filename) td->filename = strdup(jobname); @@ -844,7 +846,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) else td->nr_uniq_files = td->open_files; - if (td->filetype == FIO_TYPE_FILE || td->filename) { + if (td->filetype == FIO_TYPE_FILE) { char tmp[PATH_MAX]; int len = 0; @@ -867,10 +869,10 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) memset(f, 0, sizeof(*f)); f->fd = -1; - if (td->filename) + if (fn_given) sprintf(tmp + len, "%s", td->filename); else - sprintf(tmp + len, "%s.%d.%d", jobname, td->thread_number, i); + sprintf(tmp + len, "%s.%d.%d", td->filename, td->thread_number, i); f->file_name = strdup(tmp); } } else {