提交 4141d4c2 编写于 作者: A aliguori

Return -errno on write failure (Gleb Natapov)

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



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6324 c046a42c-6fe2-441c-8c8c-71466251a162
上级 42fb2807
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册