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 790d3a1e32c9d4c046bb17be0f10f44a74f5fef3..8f92e93f065d7b57234bbdbccf8bab875f785fe9 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]);
 }