From: Christoph Hellwig Date: Mon, 25 May 2009 08:08:52 +0000 (+0200) Subject: fix raw_pread_aligned return value X-Git-Tag: v0.10.6~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5982abd9ca27b80e5d006982c427a5299e080fe9;p=thirdparty%2Fqemu.git fix raw_pread_aligned return value 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 Signed-off-by: Anthony Liguori --- diff --git a/block-raw-posix.c b/block-raw-posix.c index 85ca7049467..af3d468750e 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -234,7 +234,7 @@ static int raw_pread_aligned(BlockDriverState *bs, int64_t offset, label__raw_read__success: - return ret; + return (ret < 0) ? -errno : ret; } /*