mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
vsock/vmci: convert VMCI error code to -ENOMEM on receive
This adds conversion of VMCI specific error code to general -ENOMEM. It is preparation for the next patch, which changes af_vsock.c behaviour on receive to pass value returned from transport to the user. Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
b380339919
commit
f59f3006ca
@ -1831,10 +1831,17 @@ static ssize_t vmci_transport_stream_dequeue(
|
||||
size_t len,
|
||||
int flags)
|
||||
{
|
||||
ssize_t err;
|
||||
|
||||
if (flags & MSG_PEEK)
|
||||
return vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0);
|
||||
err = vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0);
|
||||
else
|
||||
return vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0);
|
||||
err = vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0);
|
||||
|
||||
if (err < 0)
|
||||
err = -ENOMEM;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static ssize_t vmci_transport_stream_enqueue(
|
||||
|
Loading…
Reference in New Issue
Block a user