diff options
author | Christoph Hellwig <hch@lst.de> | 2009-05-25 10:08:52 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-05-27 09:45:37 -0500 |
commit | 94c6d6d815c0295b101b45a101007fcf22c5171a (patch) | |
tree | 95c94f7c8a2ae2783d6e810f00e4b00e3f1b9d88 /block | |
parent | afd3216027e3b28b0e180ac99d87e981d169b91c (diff) | |
download | qemu-94c6d6d815c0295b101b45a101007fcf22c5171a.zip qemu-94c6d6d815c0295b101b45a101007fcf22c5171a.tar.gz qemu-94c6d6d815c0295b101b45a101007fcf22c5171a.tar.bz2 |
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 <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/raw-posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } /* |