From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Np3VS-0003aD-To for qemu-devel@nongnu.org; Tue, 09 Mar 2010 12:46:10 -0500 Received: from [199.232.76.173] (port=54842 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Np3VS-0003a1-98 for qemu-devel@nongnu.org; Tue, 09 Mar 2010 12:46:10 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Np3VQ-0008Un-NE for qemu-devel@nongnu.org; Tue, 09 Mar 2010 12:46:09 -0500 Received: from mail-ew0-f214.google.com ([209.85.219.214]:41355) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Np3VQ-0008Ql-8Q for qemu-devel@nongnu.org; Tue, 09 Mar 2010 12:46:08 -0500 Received: by ewy6 with SMTP id 6so4310443ewy.17 for ; Tue, 09 Mar 2010 09:45:08 -0800 (PST) Message-ID: <4B96891F.7070207@codemonkey.ws> Date: Tue, 09 Mar 2010 11:45:03 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 01/10] cow: return errno instead of -1 References: <001703bb3cac98fecb6d5003c8604d350931c3d3.1267692963.git.quintela@redhat.com> In-Reply-To: <001703bb3cac98fecb6d5003c8604d350931c3d3.1267692963.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 03/04/2010 03:00 AM, Juan Quintela wrote: > Remove not needed ret = 0 assignment. > > Signed-off-by: Juan Quintela > Applied all. Thanks. Regards, Anthony Liguori > --- > block/cow.c | 5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/block/cow.c b/block/cow.c > index 3733385..97e9745 100644 > --- a/block/cow.c > +++ b/block/cow.c > @@ -224,7 +224,7 @@ static int cow_create(const char *filename, QEMUOptionParameter *options) > cow_fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, > 0644); > if (cow_fd< 0) > - return -1; > + return -errno; > memset(&cow_header, 0, sizeof(cow_header)); > cow_header.magic = cpu_to_be32(COW_MAGIC); > cow_header.version = cpu_to_be32(COW_VERSION); > @@ -251,7 +251,7 @@ static int cow_create(const char *filename, QEMUOptionParameter *options) > cow_header.size = cpu_to_be64(image_sectors * 512); > ret = qemu_write_full(cow_fd,&cow_header, sizeof(cow_header)); > if (ret != sizeof(cow_header)) { > - ret = -1; > + ret = -errno; > goto exit; > } > > @@ -262,7 +262,6 @@ static int cow_create(const char *filename, QEMUOptionParameter *options) > goto exit; > } > > - ret = 0; > exit: > close(cow_fd); > return ret; >