qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 3/3] Return -errno on write failure


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH v2 3/3] Return -errno on write failure
Date: Thu, 15 Jan 2009 14:44:48 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Gleb Natapov wrote:
Signed-off-by: Gleb Natapov <address@hidden>

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;
 }







reply via email to

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