aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/profiling/SocketProfilingConnection.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/profiling/SocketProfilingConnection.cpp b/src/profiling/SocketProfilingConnection.cpp
index 47fc62f7f0..45b7f9dcfe 100644
--- a/src/profiling/SocketProfilingConnection.cpp
+++ b/src/profiling/SocketProfilingConnection.cpp
@@ -125,7 +125,12 @@ Packet SocketProfilingConnection::ReadPacket(uint32_t timeout)
packetData = std::make_unique<char[]>(dataLength);
}
- if (dataLength != recv(m_Socket[0].fd, packetData.get(), dataLength, 0))
+ ssize_t receivedLength = recv(m_Socket[0].fd, packetData.get(), dataLength, 0);
+ if (receivedLength < 0)
+ {
+ throw armnn::RuntimeException(std::string("Error occured on recv: ") + strerror(errno));
+ }
+ if (dataLength != static_cast<uint32_t>(receivedLength))
{
// What do we do here if we can't read in a full packet?
throw armnn::RuntimeException("Invalid MIPE packet");