diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-09 11:53:09 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-08-29 10:46:58 +0100 |
commit | 79d9b6566b90efac072720f37a1b57d73f539264 (patch) | |
tree | 69ab1d44cfc25c624e9a7c29e73c69843a223b1a /qemu-coroutine-io.c | |
parent | a3462c656128e7b900ccc5d436f9e858d07de264 (diff) |
qemu-coroutine-io: fix for Win32
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-coroutine-io.c')
-rw-r--r-- | qemu-coroutine-io.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qemu-coroutine-io.c b/qemu-coroutine-io.c index 054ca70627..d4049260da 100644 --- a/qemu-coroutine-io.c +++ b/qemu-coroutine-io.c @@ -34,13 +34,15 @@ 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) { - if (errno == EAGAIN) { + err = socket_error(); + if (err == EAGAIN || err == EWOULDBLOCK) { qemu_coroutine_yield(); } else if (done == 0) { return -1; |