Fix crash with iolog
authorJens Axboe <jens.axboe@oracle.com>
Thu, 15 May 2008 07:17:42 +0000 (09:17 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 15 May 2008 07:17:42 +0000 (09:17 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
log.c

diff --git a/log.c b/log.c
index 790d3a1..8f92e93 100644 (file)
--- a/log.c
+++ b/log.c
@@ -40,6 +40,13 @@ void log_file(struct thread_data *td, struct fio_file *f,
        if (!td->o.write_iolog_file)
                return;
 
+
+       /*
+        * this happens on the pre-open/close done before the job starts
+        */
+       if (!td->iolog_f)
+               return;
+
        fprintf(td->iolog_f, "%s %s\n", f->file_name, act[what]);
 }