Skip to contentSkip to conversation

raw-posix: Fix bdrv_flush error return values

PATCH In review Kevin Wolf 2 participants 2 messages Sep 14, 2011 Block layer

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 raw-posix: Fix bdrv_flush error return values

bdrv_flush is supposed to use 0/-errno return values

---
 block/raw-posix.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
block/raw-posix.c +8 -1
index a624f56..305998d 100644
@@ -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
Signature · 1 line
1.7.6