[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/10] qcow: return errno instead of -1
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 04/10] qcow: return errno instead of -1 |
Date: |
Wed, 3 Mar 2010 13:06:54 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
block/qcow.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/qcow.c b/block/qcow.c
index 003db1e..c619984 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -766,7 +766,7 @@ static int qcow_create(const char *filename,
QEMUOptionParameter *options)
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
if (fd < 0)
- return -1;
+ return -errno;
memset(&header, 0, sizeof(header));
header.magic = cpu_to_be32(QCOW_MAGIC);
header.version = cpu_to_be32(QCOW_VERSION);
@@ -804,14 +804,14 @@ static int qcow_create(const char *filename,
QEMUOptionParameter *options)
/* write all the data */
ret = qemu_write_full(fd, &header, sizeof(header));
if (ret != sizeof(header)) {
- ret = -1;
+ ret = -errno;
goto exit;
}
if (backing_file) {
ret = qemu_write_full(fd, backing_file, backing_filename_len);
if (ret != backing_filename_len) {
- ret = -1;
+ ret = -errno;
goto exit;
}
@@ -821,7 +821,7 @@ static int qcow_create(const char *filename,
QEMUOptionParameter *options)
for(i = 0;i < l1_size; i++) {
ret = qemu_write_full(fd, &tmp, sizeof(tmp));
if (ret != sizeof(tmp)) {
- ret = -1;
+ ret = -errno;
goto exit;
}
}
--
1.6.5.2
- [Qemu-devel] [PATCH 00/10] FORTIFY_SOURCE followup, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 01/10] cow: return errno instead of -1, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 02/10] slirp: check system() success, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 03/10] qcow2: return errno instead of -1, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 04/10] qcow: return errno instead of -1,
Juan Quintela <=
- [Qemu-devel] [PATCH 05/10] vmdk: return errno instead of -1, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 06/10] vl: exit if we are not able to write into the pipe, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 07/10] vmdk: make vmdk_snapshot_create return -errno, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 08/10] vmdk: fix double free, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 09/10] vmdk: share cleanup code, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 10/10] block: print errno on error, Juan Quintela, 2010/03/03