Only set O_RDWR for open() when readonly isn't set
authorJens Axboe <jens.axboe@oracle.com>
Fri, 7 Mar 2008 12:42:31 +0000 (13:42 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 7 Mar 2008 12:42:31 +0000 (13:42 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c

index 37a3439..5c02f1c 100644 (file)
@@ -291,9 +291,8 @@ int generic_open_file(struct thread_data *td, struct fio_file *f)
 
 open_again:
        if (td_write(td)) {
-               assert(!read_only);
-
-               flags |= O_RDWR;
+               if (!read_only)
+                       flags |= O_RDWR;
 
                if (f->filetype == FIO_TYPE_FILE)
                        flags |= O_CREAT;