[PATCH] ETA fixes
[fio.git] / fio-ini.c
index 234058980b3d11ab9e7e45f4c896e1d8495eaea3..0c83f70246d4b23f59af47b54a862920db2edc7f 100644 (file)
--- a/fio-ini.c
+++ b/fio-ini.c
@@ -37,7 +37,7 @@
 #define DEF_ZONE_SIZE          (0)
 #define DEF_ZONE_SKIP          (0)
 
-static char fio_version_string[] = "fio 1.1";
+static char fio_version_string[] = "fio 1.3";
 
 static int repeatable = DEF_RAND_REPEAT;
 static char *ini_file;
@@ -204,14 +204,18 @@ static int add_job(struct thread_data *td, const char *jobname, int prioclass,
                td->zone_size = 0;
 
        td->filetype = FIO_TYPE_FILE;
-       if (!stat(jobname, &sb) && S_ISBLK(sb.st_mode))
-               td->filetype = FIO_TYPE_BD;
+       if (!stat(jobname, &sb)) {
+               if (S_ISBLK(sb.st_mode))
+                       td->filetype = FIO_TYPE_BD;
+               else if (S_ISCHR(sb.st_mode))
+                       td->filetype = FIO_TYPE_CHAR;
+       }
 
        if (td->filetype == FIO_TYPE_FILE) {
                if (td->directory[0] != '\0')
-                       sprintf(td->file_name, "%s/%s.%d", td->directory, jobname, td->thread_number);
+                       sprintf(td->file_name, "%s/%s.%d", td->directory, jobname, td->jobnum);
                else
-                       sprintf(td->file_name, "%s.%d", jobname, td->thread_number);
+                       sprintf(td->file_name, "%s.%d", jobname, td->jobnum);
        } else
                strcpy(td->file_name, jobname);
 
@@ -259,6 +263,7 @@ static int add_job(struct thread_data *td, const char *jobname, int prioclass,
 
                td_new->numjobs = 1;
                td_new->stonewall = 0;
+               td_new->jobnum = numjobs;
 
                if (add_job(td_new, jobname, prioclass, prio))
                        goto err;