From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M8VEz-0007Do-MH for qemu-devel@nongnu.org; Mon, 25 May 2009 04:09:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M8VEu-0007Bi-KE for qemu-devel@nongnu.org; Mon, 25 May 2009 04:09:00 -0400 Received: from [199.232.76.173] (port=55785 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8VEu-0007Bd-GA for qemu-devel@nongnu.org; Mon, 25 May 2009 04:08:56 -0400 Received: from mx20.gnu.org ([199.232.41.8]:42475) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M8VEt-0008Aa-VL for qemu-devel@nongnu.org; Mon, 25 May 2009 04:08:56 -0400 Received: from verein.lst.de ([213.95.11.210]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M8VEs-0005wN-7Z for qemu-devel@nongnu.org; Mon, 25 May 2009 04:08:55 -0400 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id n4P88rIF003504 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 25 May 2009 10:08:53 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id n4P88rvd003502 for qemu-devel@nongnu.org; Mon, 25 May 2009 10:08:53 +0200 Date: Mon, 25 May 2009 10:08:52 +0200 From: Christoph Hellwig Message-ID: <20090525080852.GA3441@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] 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 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 Index: qemu/block/raw-posix.c =================================================================== --- qemu.orig/block/raw-posix.c 2009-05-25 10:04:39.044840256 +0200 +++ qemu/block/raw-posix.c 2009-05-25 10:05:16.233848281 +0200 @@ -253,7 +253,7 @@ static int raw_pread_aligned(BlockDriver label__raw_read__success: - return ret; + return (ret < 0) ? -errno : ret; } /*