Always return what we've got from the socket module (error or number of

bytes received), but not B_OK on success.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28337 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-10-26 15:52:46 +00:00
parent 3cead3c68e
commit 801e9bd9f1

View File

@ -94,14 +94,13 @@ stack_interface_recvfrom(net_socket* socket, void* data, size_t length,
message.msg_controllen = 0;
message.msg_flags = 0;
status_t error = gNetSocketModule.receive(socket, &message, data, length,
ssize_t received = gNetSocketModule.receive(socket, &message, data, length,
flags);
if (error < 0)
return error;
if (_addressLength != NULL)
if (received >= 0 && _addressLength != NULL)
*_addressLength = message.msg_namelen;
return B_OK;
return received;
}