summaryrefslogtreecommitdiffstats
path: root/util/qemu-coroutine-io.c
diff options
context:
space:
mode:
authorDaniel P. Berrange2016-03-07 21:36:03 +0100
committerDaniel P. Berrange2016-03-10 18:19:34 +0100
commitb16a44e13e89ee397a3d9a9e3cfa1605c3c1dc68 (patch)
tree894551b8e7841e2fddfd790c204b7ef453d6f2eb /util/qemu-coroutine-io.c
parentosdep: add wrappers for socket functions (diff)
downloadqemu-b16a44e13e89ee397a3d9a9e3cfa1605c3c1dc68.tar.gz
qemu-b16a44e13e89ee397a3d9a9e3cfa1605c3c1dc68.tar.xz
qemu-b16a44e13e89ee397a3d9a9e3cfa1605c3c1dc68.zip
osdep: remove use of socket_error() from all code
Now that QEMU wraps the Win32 sockets methods to automatically set errno upon failure, there is no reason for callers to use the socket_error() method. They can rely on accessing errno even on Win32. Remove all use of socket_error() from general code, leaving it as a static method in oslib-win32.c only. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'util/qemu-coroutine-io.c')
-rw-r--r--util/qemu-coroutine-io.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/util/qemu-coroutine-io.c b/util/qemu-coroutine-io.c
index 0d5041c1c3..91b9357d4a 100644
--- a/util/qemu-coroutine-io.c
+++ b/util/qemu-coroutine-io.c
@@ -35,18 +35,16 @@ qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt,
{
size_t done = 0;
ssize_t ret;
- int err;
while (done < bytes) {
ret = iov_send_recv(sockfd, iov, iov_cnt,
offset + done, bytes - done, do_send);
if (ret > 0) {
done += ret;
} else if (ret < 0) {
- err = socket_error();
- if (err == EAGAIN || err == EWOULDBLOCK) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
qemu_coroutine_yield();
} else if (done == 0) {
- return -err;
+ return -errno;
} else {
break;
}