aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/SocketProfilingConnection.cpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2019-10-04 04:25:43 -0700
committerJim Flynn Arm <jim.flynn@arm.com>2019-10-04 11:58:15 +0000
commite11ff89e92d2d4343a26f1b0d988dea795561da7 (patch)
tree784479fc7d0e427251b8e107352e27c35ab644e4 /src/profiling/SocketProfilingConnection.cpp
parent4951b8c62905ffec880bf304b00aac5cffc6c9ac (diff)
downloadarmnn-e11ff89e92d2d4343a26f1b0d988dea795561da7.tar.gz
IVGCVSW-3949 Fix signed/unsigned comparison bug
Change-Id: I6a7a809e2d30f137f8221a7d30091d3d6821c213 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/SocketProfilingConnection.cpp')
-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");