From 173081581f94dc4f9f203eb7a7922fc843bfafde Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 7 Mar 2008 13:42:31 +0100 Subject: [PATCH] Only set O_RDWR for open() when readonly isn't set Signed-off-by: Jens Axboe --- filesetup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/filesetup.c b/filesetup.c index 37a34399..5c02f1c4 100644 --- a/filesetup.c +++ b/filesetup.c @@ -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; -- 2.25.1