aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Monahan <david.monahan@arm.com>2020-01-24 09:13:33 +0000
committerColm Donelan <colm.donelan@arm.com>2020-01-24 16:06:41 +0000
commita0d189697bb549a37886790536be7e6879ee943a (patch)
tree477e05fcc4b91852fd8511e38a3d932a09d24975
parente61f0712dc480f70372fcfe0921a85a7de53661b (diff)
downloadarmnn-a0d189697bb549a37886790536be7e6879ee943a.tar.gz
Updates to Filesystem.cpp/hpp and NetworkSockets.cpp/hpp to fix failing master
Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I566c29754aa586167a938d2c2b4e5069a39b5e50
-rw-r--r--src/armnnUtils/Filesystem.cpp11
-rw-r--r--src/armnnUtils/Filesystem.hpp2
-rw-r--r--src/armnnUtils/NetworkSockets.cpp2
-rw-r--r--src/armnnUtils/NetworkSockets.hpp2
4 files changed, 12 insertions, 5 deletions
diff --git a/src/armnnUtils/Filesystem.cpp b/src/armnnUtils/Filesystem.cpp
index 08c447b3f6..6c8175b202 100644
--- a/src/armnnUtils/Filesystem.cpp
+++ b/src/armnnUtils/Filesystem.cpp
@@ -18,15 +18,22 @@ namespace armnnUtils
namespace Filesystem
{
-long GetFileSize(const char* path)
+long long GetFileSize(const char* path)
{
-#if defined(__unix__)
+#if defined(__ANDROID__)
struct stat statusBuffer;
if (stat(path, & statusBuffer) != 0)
{
return -1;
}
return statusBuffer.st_size;
+#elif defined(__unix__)
+ struct stat statusBuffer;
+ if (stat(path, & statusBuffer) != 0)
+ {
+ return -1;
+ }
+ return static_cast<long long>(statusBuffer.st_size);
#elif defined(_MSC_VER)
WIN32_FILE_ATTRIBUTE_DATA attr;
if (::GetFileAttributesEx(path, GetFileExInfoStandard, &attr) == 0)
diff --git a/src/armnnUtils/Filesystem.hpp b/src/armnnUtils/Filesystem.hpp
index d6dc5b97fd..2fe720dcf6 100644
--- a/src/armnnUtils/Filesystem.hpp
+++ b/src/armnnUtils/Filesystem.hpp
@@ -10,7 +10,7 @@ namespace armnnUtils
namespace Filesystem
{
-long GetFileSize(const char* path);
+long long GetFileSize(const char* path);
bool Remove(const char* path);
diff --git a/src/armnnUtils/NetworkSockets.cpp b/src/armnnUtils/NetworkSockets.cpp
index aa9164e1d2..3f17a1bcb3 100644
--- a/src/armnnUtils/NetworkSockets.cpp
+++ b/src/armnnUtils/NetworkSockets.cpp
@@ -88,7 +88,7 @@ int Poll(PollFd* fds, nfds_t numFds, int timeout)
}
-armnnUtils::Sockets::Socket Accept(Socket s, sockaddr* addr, unsigned int* addrlen, int flags)
+armnnUtils::Sockets::Socket Accept(Socket s, sockaddr* addr, socklen_t* addrlen, int flags)
{
#if defined(__unix__)
return accept4(s, addr, addrlen, flags);
diff --git a/src/armnnUtils/NetworkSockets.hpp b/src/armnnUtils/NetworkSockets.hpp
index 8b192909b1..b9e58aac1d 100644
--- a/src/armnnUtils/NetworkSockets.hpp
+++ b/src/armnnUtils/NetworkSockets.hpp
@@ -53,7 +53,7 @@ int Ioctl(Socket s, unsigned long int cmd, void* arg);
int Poll(PollFd* fds, nfds_t numFds, int timeout);
-Socket Accept(Socket s, sockaddr* addr, unsigned int* addrlen, int flags);
+Socket Accept(Socket s, sockaddr* addr, socklen_t* addrlen, int flags);
}
}