aboutsummaryrefslogtreecommitdiff
path: root/block/raw-posix.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-09-14 11:22:26 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-19 11:34:33 +0200
commit074abad3264bf2bb7cfd279b7457416b318716ca (patch)
treebb257a05a4617c80248567074437e0a5dd79e613 /block/raw-posix.c
parent973b3d0a7b2823f510e948283284f103ede43c49 (diff)
raw-posix: Fix bdrv_flush error return values
bdrv_flush is supposed to use 0/-errno return values Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/raw-posix.c')
-rw-r--r--block/raw-posix.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index a624f56f86..305998ddb3 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -839,7 +839,14 @@ static int raw_create(const char *filename, QEMUOptionParameter *options)
static int raw_flush(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
- return qemu_fdatasync(s->fd);
+ int ret;
+
+ ret = qemu_fdatasync(s->fd);
+ if (ret < 0) {
+ return -errno;
+ }
+
+ return 0;
}
#ifdef CONFIG_XFS