All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, amit.shah@redhat.com
Subject: [Qemu-devel] [PATCH 05/10] vmdk: return errno instead of -1
Date: Wed,  3 Mar 2010 13:06:55 +0100	[thread overview]
Message-ID: <c8e79edfb5aa3ddce0fae99f0d206b4fdf384438.1267617582.git.quintela@redhat.com> (raw)
In-Reply-To: <cover.1267617582.git.quintela@redhat.com>
In-Reply-To: <cover.1267617582.git.quintela@redhat.com>

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 block/vmdk.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/block/vmdk.c b/block/vmdk.c
index 56c28a0..5b1d197 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -740,7 +740,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
     fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_LARGEFILE,
               0644);
     if (fd < 0)
-        return -1;
+        return -errno;
     magic = cpu_to_be32(VMDK4_MAGIC);
     memset(&header, 0, sizeof(header));
     header.version = cpu_to_le32(1);
@@ -777,18 +777,18 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
     /* write all the data */
     ret = qemu_write_full(fd, &magic, sizeof(magic));
     if (ret != sizeof(magic)) {
-        ret = -1;
+        ret = -errno;
         goto exit;
     }
     ret = qemu_write_full(fd, &header, sizeof(header));
     if (ret != sizeof(header)) {
-        ret = -1;
+        ret = -errno;
         goto exit;
     }

     ret = ftruncate(fd, header.grain_offset << 9);
     if (ret < 0) {
-        ret = -1;
+        ret = -errno;
         goto exit;
     }

@@ -798,7 +798,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
          i < gt_count; i++, tmp += gt_size) {
         ret = qemu_write_full(fd, &tmp, sizeof(tmp));
         if (ret != sizeof(tmp)) {
-            ret = -1;
+            ret = -errno;
             goto exit;
         }
     }
@@ -809,7 +809,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
          i < gt_count; i++, tmp += gt_size) {
         ret = qemu_write_full(fd, &tmp, sizeof(tmp));
         if (ret != sizeof(tmp)) {
-            ret = -1;
+            ret = -errno;
             goto exit;
         }
     }
@@ -831,7 +831,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
     lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET);
     ret = qemu_write_full(fd, desc, strlen(desc));
     if (ret != strlen(desc)) {
-        ret = -1;
+        ret = -errno;
         goto exit;
     }

-- 
1.6.5.2

  parent reply	other threads:[~2010-03-03 12:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 12:06 [Qemu-devel] [PATCH 00/10] FORTIFY_SOURCE followup Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 01/10] cow: return errno instead of -1 Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 02/10] slirp: check system() success Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 03/10] qcow2: return errno instead of -1 Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 04/10] qcow: " Juan Quintela
2010-03-03 12:06 ` Juan Quintela [this message]
2010-03-03 12:06 ` [Qemu-devel] [PATCH 06/10] vl: exit if we are not able to write into the pipe Juan Quintela
2010-03-03 13:51   ` [Qemu-devel] " Kevin Wolf
2010-03-03 14:00     ` Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 07/10] vmdk: make vmdk_snapshot_create return -errno Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 08/10] vmdk: fix double free Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 09/10] vmdk: share cleanup code Juan Quintela
2010-03-03 12:07 ` [Qemu-devel] [PATCH 10/10] block: print errno on error Juan Quintela
2010-03-03 14:01   ` [Qemu-devel] " Kevin Wolf
2010-03-03 14:36     ` Paolo Bonzini
2010-03-03 16:21       ` Juan Quintela
2010-03-04  9:00 [Qemu-devel] [PATCH v2 00/10] FORTIFY_SOURCE followup Juan Quintela
2010-03-04  9:00 ` [Qemu-devel] [PATCH 05/10] vmdk: return errno instead of -1 Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8e79edfb5aa3ddce0fae99f0d206b4fdf384438.1267617582.git.quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.