From: Kevin Wolf Date: Wed, 14 Sep 2011 09:22:26 +0000 (+0200) Subject: raw-posix: Fix bdrv_flush error return values X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=074abad3264bf2bb7cfd279b7457416b318716ca;p=qemu.git raw-posix: Fix bdrv_flush error return values bdrv_flush is supposed to use 0/-errno return values Signed-off-by: Kevin Wolf --- 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