qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 01/10] cow: return errno instead of -1


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 01/10] cow: return errno instead of -1
Date: Tue, 09 Mar 2010 11:45:03 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 03/04/2010 03:00 AM, Juan Quintela wrote:
Remove not needed ret = 0 assignment.

Signed-off-by: Juan Quintela<address@hidden>

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;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]