From cb114a80e11d358116a96566cb9104add65870f0 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Fri, 4 Aug 2017 13:48:42 -0400 Subject: [PATCH] reverted ino_t cast and added fix only for android --- include/libtorrent/file.hpp | 8 ++++++++ src/file.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/file.hpp b/include/libtorrent/file.hpp index 3b6bca3d5..e6bc80311 100644 --- a/include/libtorrent/file.hpp +++ b/include/libtorrent/file.hpp @@ -109,7 +109,15 @@ namespace libtorrent { WIN32_FIND_DATAW m_fd; #else DIR* m_handle; +#ifdef TORRENT_ANDROID +// this is due to a documented bug in android related to a wrong type +// of ino_t, for general discussion and internal changes see: +// https://issuetracker.google.com/issues/37011207 - for general discussion +// https://android-review.googlesource.com/#/c/platform/system/core/+/123482/ + std::uint64_t m_inode; +#else ino_t m_inode; +#endif // TORRENT_ANDROID std::string m_name; #endif bool m_done; diff --git a/src/file.cpp b/src/file.cpp index 07058f220..b40adb3a3 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -416,7 +416,7 @@ static_assert(!(open_mode::sparse & open_mode::attribute_mask), "internal flags errno = 0; if ((de = ::readdir(m_handle)) != nullptr) { - m_inode = static_cast(de->d_ino); + m_inode = de->d_ino; m_name = de->d_name; } else