qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6324] Return -errno on write failure (Gleb Natapov)
@ 2009-01-15 20:44 Anthony Liguori
  2009-01-15 21:20 ` François Revol
  0 siblings, 1 reply; 16+ messages in thread
From: Anthony Liguori @ 2009-01-15 20:44 UTC (permalink / raw)
  To: qemu-devel

Revision: 6324
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6324
Author:   aliguori
Date:     2009-01-15 20:44:26 +0000 (Thu, 15 Jan 2009)

Log Message:
-----------
Return -errno on write failure (Gleb Natapov)

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/block-raw-posix.c

Modified: trunk/block-raw-posix.c
===================================================================
--- trunk/block-raw-posix.c	2009-01-15 20:43:39 UTC (rev 6323)
+++ trunk/block-raw-posix.c	2009-01-15 20:44:26 UTC (rev 6324)
@@ -252,7 +252,7 @@
 
     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 @@
                               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 @@
 
 label__raw_write__success:
 
-    return ret;
+    return  (ret < 0) ? -errno : ret;
 }
 
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-01-19 20:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 20:44 [Qemu-devel] [6324] Return -errno on write failure (Gleb Natapov) Anthony Liguori
2009-01-15 21:20 ` François Revol
2009-01-15 22:15   ` M. Warner Losh
2009-01-15 22:33     ` François Revol
2009-01-16  7:31   ` Gleb Natapov
2009-01-16 17:37   ` Ian Jackson
2009-01-16 18:36     ` François Revol
2009-01-16 18:49       ` Anthony Liguori
2009-01-16 19:17         ` François Revol
2009-01-16 19:31           ` Anthony Liguori
2009-01-16 19:41             ` François Revol
2009-01-19 11:37       ` Ian Jackson
2009-01-19 18:52         ` François Revol
2009-01-19 19:47           ` Lennart Sorensen
2009-01-19 20:31             ` François Revol
2009-01-19 20:03           ` M. Warner Losh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).