From 801e9bd9f1d4fed10584ded4362638579991c8f5 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 26 Oct 2008 15:52:46 +0000 Subject: [PATCH] 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 --- src/add-ons/kernel/network/stack/stack_interface.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/add-ons/kernel/network/stack/stack_interface.cpp b/src/add-ons/kernel/network/stack/stack_interface.cpp index 5f8356a963..20e23567d3 100644 --- a/src/add-ons/kernel/network/stack/stack_interface.cpp +++ b/src/add-ons/kernel/network/stack/stack_interface.cpp @@ -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; }