qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 94c6d6d] fix raw_pread_aligned return value


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 94c6d6d] fix raw_pread_aligned return value
Date: Mon, 08 Jun 2009 13:03:07 -0000

From: Christoph Hellwig <address@hidden>

raw_pread_aligned currently returns the raw return value from
lseek/read, which is always -1 in case of an error.  But the
callers higher up the stack expect it to return the negated
errno just like raw_pwrite_aligned.

Signed-off-by: Christoph Hellwig <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 86e3067..57da1df 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -249,7 +249,7 @@ static int raw_pread_aligned(BlockDriverState *bs, int64_t 
offset,
 
 label__raw_read__success:
 
-    return ret;
+    return  (ret < 0) ? -errno : ret;
 }
 
 /*




reply via email to

[Prev in Thread] Current Thread [Next in Thread]