summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--block/raw-posix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 7ce72e9e4e..ed8db5ed1a 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -993,12 +993,12 @@ static int hdev_create(const char *filename, QEMUOptionParameter *options)
 
     fd = open(filename, O_WRONLY | O_BINARY);
     if (fd < 0)
-        return -EIO;
+        return -errno;
 
     if (fstat(fd, &stat_buf) < 0)
-        ret = -EIO;
+        ret = -errno;
     else if (!S_ISBLK(stat_buf.st_mode) && !S_ISCHR(stat_buf.st_mode))
-        ret = -EIO;
+        ret = -ENODEV;
     else if (lseek(fd, 0, SEEK_END) < total_size * 512)
         ret = -ENOSPC;