From: Jens Axboe Date: Tue, 13 Mar 2007 10:17:07 +0000 (+0100) Subject: If we use jobname as file, only append job/file numer for nrfiles > 1 X-Git-Tag: fio-1.14~23 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=7b05a215c8c39b8c878297b90eba112fe9176542 If we use jobname as file, only append job/file numer for nrfiles > 1 Otherwise we break the abillity to do [/dev/sda] for /dev/sda and so on. Signed-off-by: Jens Axboe --- diff --git a/init.c b/init.c index ea531591..ba932bf3 100644 --- a/init.c +++ b/init.c @@ -832,9 +832,13 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) if (!td->filename) { td->filename = strdup(jobname); - for (i = 0; i < td->nr_files; i++) { - sprintf(fname, "%s.%d.%d", td->filename, td->thread_number, i); - add_file(td, fname); + if (td->nr_files == 1) + add_file(td, td->filename); + else { + for (i = 0; i < td->nr_files; i++) { + sprintf(fname, "%s.%d.%d", td->filename, td->thread_number, i); + add_file(td, fname); + } } }