From: Max Reitz Date: Wed, 25 Feb 2015 18:08:28 +0000 (-0500) Subject: coroutine-io: Return -errno in case of error X-Git-Tag: v2.3.0-rc1~13^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4adf4180f284caf4ea9cd83ce37085d50a52603b;p=thirdparty%2Fqemu.git coroutine-io: Return -errno in case of error In case qemu_co_sendv_recvv() fails without any data read, there is no reason not to return the perfectly fine error number retrieved from socket_error(). Signed-off-by: Max Reitz Message-Id: <1424887718-10800-16-git-send-email-mreitz@redhat.com> Signed-off-by: Paolo Bonzini --- diff --git a/qemu-coroutine-io.c b/qemu-coroutine-io.c index d4049260da0..28dc7351acc 100644 --- a/qemu-coroutine-io.c +++ b/qemu-coroutine-io.c @@ -45,7 +45,7 @@ qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt, if (err == EAGAIN || err == EWOULDBLOCK) { qemu_coroutine_yield(); } else if (done == 0) { - return -1; + return -err; } else { break; }