From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGyeg-0005Lx-7E for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGyeV-0005Ci-D9 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:27 -0400 Received: from [199.232.76.173] (port=54829 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGyeU-0005Bw-Ho for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:22 -0400 Received: from mx2.redhat.com ([66.187.237.31]:35960) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGyeT-0007yW-CS for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:10:21 -0400 From: Glauber Costa Date: Wed, 17 Jun 2009 13:09:56 -0400 Message-Id: <1245258604-2843-8-git-send-email-glommer@redhat.com> In-Reply-To: <1245258604-2843-7-git-send-email-glommer@redhat.com> References: <1245258604-2843-1-git-send-email-glommer@redhat.com> <1245258604-2843-2-git-send-email-glommer@redhat.com> <1245258604-2843-3-git-send-email-glommer@redhat.com> <1245258604-2843-4-git-send-email-glommer@redhat.com> <1245258604-2843-5-git-send-email-glommer@redhat.com> <1245258604-2843-6-git-send-email-glommer@redhat.com> <1245258604-2843-7-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 07/15] fix raw_pread_aligned return value List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, Christoph Hellwig From: Christoph Hellwig 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 Signed-off-by: Glauber Costa --- 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 85ca704..af3d468 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; } /* -- 1.6.2.2