aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/raw-posix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 5790206741..ccb014a4d1 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -133,6 +133,7 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
s->lseek_err_cnt = 0;
s->open_flags |= O_BINARY;
+ s->open_flags &= ~O_ACCMODE;
if ((flags & BDRV_O_ACCESS) == BDRV_O_RDWR) {
s->open_flags |= O_RDWR;
} else {