Commit 736d0c25ed3e13a3af3d24524c05be1bb1ff5158
Committed by
Anthony Liguori
1 parent
d3fa1e0f
raw-posix: open flags use BDRV_ namespace, not posix namespace
The flags argument to raw_common_open() contain bits defined by the BDRV_O_* namespace, not the posix O_* namespace. Adjust to use the correct constants. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing
1 changed file
with
1 additions
and
1 deletions
block/raw-posix.c
@@ -133,7 +133,7 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, | @@ -133,7 +133,7 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, | ||
133 | s->lseek_err_cnt = 0; | 133 | s->lseek_err_cnt = 0; |
134 | 134 | ||
135 | s->open_flags |= O_BINARY; | 135 | s->open_flags |= O_BINARY; |
136 | - if ((flags & BDRV_O_ACCESS) == O_RDWR) { | 136 | + if ((flags & BDRV_O_ACCESS) == BDRV_O_RDWR) { |
137 | s->open_flags |= O_RDWR; | 137 | s->open_flags |= O_RDWR; |
138 | } else { | 138 | } else { |
139 | s->open_flags |= O_RDONLY; | 139 | s->open_flags |= O_RDONLY; |