[PATCH] Fix character + O_DIRECT

Just clear ->odirect if it's a character device, it doesn't apply.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/init.c b/init.c
index 7d7c9d6..0c888b8 100644
--- a/init.c
+++ b/init.c
@@ -508,6 +508,12 @@
 	}
 	if (td->bs_unaligned && (td->odirect || td->io_ops->flags & FIO_RAWIO))
 		log_err("fio: bs_unaligned may not work with raw io\n");
+
+	/*
+	 * O_DIRECT and char doesn't mix, clear that flag if necessary.
+	 */
+	if (td->filetype == FIO_TYPE_CHAR && td->odirect)
+		td->odirect = 0;
 }
 
 /*
@@ -564,8 +570,6 @@
 	if (td->odirect)
 		td->io_ops->flags |= FIO_RAWIO;
 
-	fixup_options(td);
-
 	td->filetype = FIO_TYPE_FILE;
 	if (!stat(jobname, &sb)) {
 		if (S_ISBLK(sb.st_mode))
@@ -574,6 +578,8 @@
 			td->filetype = FIO_TYPE_CHAR;
 	}
 
+	fixup_options(td);
+
 	if (td->filename)
 		td->nr_uniq_files = 1;
 	else