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:47:30 -0500 |
commit | 5982abd9ca27b80e5d006982c427a5299e080fe9 (patch) | |
tree | 15a362fdbe23bade23f12b952024f62e1147441f | |
parent | 738208b656004e3e7a727b546107556213fbca82 (diff) | |
download | qemu-5982abd9ca27b80e5d006982c427a5299e080fe9.tar.gz |
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>
-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 85ca704946..af3d468750 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; } /* |