mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
qemu-coroutine-io: fix for Win32
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
a3462c6561
commit
79d9b6566b
2 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue