From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNZ5M-0006YP-Nu for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:45:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNZ5J-0006SL-3J for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:45:03 -0500 Received: from [199.232.76.173] (port=34609 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNZ5I-0006S0-KH for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:45:00 -0500 Received: from mail-qy0-f20.google.com ([209.85.221.20]:48741) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNZ5I-0000r7-7U for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:45:00 -0500 Received: by qyk13 with SMTP id 13so1921817qyk.10 for ; Thu, 15 Jan 2009 12:44:59 -0800 (PST) Message-ID: <496FA040.8000000@codemonkey.ws> Date: Thu, 15 Jan 2009 14:44:48 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 3/3] Return -errno on write failure References: <20090115101241.13211.64596.stgit@dhcp-1-237.tlv.redhat.com> <20090115101252.13211.23542.stgit@dhcp-1-237.tlv.redhat.com> In-Reply-To: <20090115101252.13211.23542.stgit@dhcp-1-237.tlv.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Gleb Natapov wrote: > Signed-off-by: Gleb Natapov > Applied. Thanks. Regards, Anthony Liguori > --- > > block-raw-posix.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/block-raw-posix.c b/block-raw-posix.c > index 2fbb714..d17af0b 100644 > --- a/block-raw-posix.c > +++ b/block-raw-posix.c > @@ -252,7 +252,7 @@ static int raw_pwrite_aligned(BlockDriverState *bs, int64_t offset, > > ret = fd_open(bs); > if (ret < 0) > - return ret; > + return -errno; > > if (offset >= 0 && lseek(s->fd, offset, SEEK_SET) == (off_t)-1) { > ++(s->lseek_err_cnt); > @@ -262,7 +262,7 @@ static int raw_pwrite_aligned(BlockDriverState *bs, int64_t offset, > s->fd, bs->filename, offset, buf, count, > bs->total_sectors, errno, strerror(errno)); > } > - return -1; > + return -EIO; > } > s->lseek_err_cnt = 0; > > @@ -277,7 +277,7 @@ static int raw_pwrite_aligned(BlockDriverState *bs, int64_t offset, > > label__raw_write__success: > > - return ret; > + return (ret < 0) ? -errno : ret; > } > > > > > >