From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYC7H-00087M-6W for qemu-devel@nongnu.org; Wed, 18 Mar 2015 07:26:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYC76-0001na-A2 for qemu-devel@nongnu.org; Wed, 18 Mar 2015 07:26:27 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:33245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYC76-0001nW-42 for qemu-devel@nongnu.org; Wed, 18 Mar 2015 07:26:16 -0400 Received: by weop45 with SMTP id p45so29688071weo.0 for ; Wed, 18 Mar 2015 04:26:15 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 18 Mar 2015 12:25:00 +0100 Message-Id: <1426677906-51657-14-git-send-email-pbonzini@redhat.com> In-Reply-To: <1426677906-51657-1-git-send-email-pbonzini@redhat.com> References: <1426677906-51657-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 13/19] coroutine-io: Return -errno in case of error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Max Reitz From: Max Reitz 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 --- qemu-coroutine-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-coroutine-io.c b/qemu-coroutine-io.c index d404926..28dc735 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; } -- 2.3.0