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 <mreitz@redhat.com> Message-Id: <1424887718-10800-16-git-send-email-mreitz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
		
							parent
							
								
									0379f474dd
								
							
						
					
					
						commit
						4adf4180f2
					
				@ -45,7 +45,7 @@ qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt,
 | 
				
			|||||||
            if (err == EAGAIN || err == EWOULDBLOCK) {
 | 
					            if (err == EAGAIN || err == EWOULDBLOCK) {
 | 
				
			||||||
                qemu_coroutine_yield();
 | 
					                qemu_coroutine_yield();
 | 
				
			||||||
            } else if (done == 0) {
 | 
					            } else if (done == 0) {
 | 
				
			||||||
                return -1;
 | 
					                return -err;
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user