From: Jens Axboe Date: Fri, 7 Mar 2008 12:42:31 +0000 (+0100) Subject: Only set O_RDWR for open() when readonly isn't set X-Git-Tag: fio-1.20-rc3~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=173081581f94dc4f9f203eb7a7922fc843bfafde;p=fio.git Only set O_RDWR for open() when readonly isn't set Signed-off-by: Jens Axboe --- 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;