fix warnings of unused return values from ftruncate() calls

This commit is contained in:
arvidn 2016-07-31 03:19:31 -04:00
parent 633d0621f8
commit 192559f245
1 changed files with 8 additions and 4 deletions

View File

@ -123,7 +123,8 @@ namespace libtorrent
m_cache_pool = 0; m_cache_pool = 0;
// attempt to make MacOS not flush this to disk, making close() // attempt to make MacOS not flush this to disk, making close()
// block for a long time // block for a long time
ftruncate(m_cache_fd, 0); int const best_effort = ftruncate(m_cache_fd, 0);
TORRENT_UNUSED(best_effort);
close(m_cache_fd); close(m_cache_fd);
m_cache_fd = -1; m_cache_fd = -1;
} }
@ -460,7 +461,8 @@ namespace libtorrent
m_cache_pool = 0; m_cache_pool = 0;
// attempt to make MacOS not flush this to disk, making close() // attempt to make MacOS not flush this to disk, making close()
// block for a long time // block for a long time
ftruncate(m_cache_fd, 0); int const best_effort = ftruncate(m_cache_fd, 0);
TORRENT_UNUSED(best_effort);
close(m_cache_fd); close(m_cache_fd);
m_cache_fd = -1; m_cache_fd = -1;
std::vector<int>().swap(m_free_list); std::vector<int>().swap(m_free_list);
@ -482,7 +484,8 @@ namespace libtorrent
#ifndef MAP_NOCACHE #ifndef MAP_NOCACHE
#define MAP_NOCACHE 0 #define MAP_NOCACHE 0
#endif #endif
ftruncate(m_cache_fd, boost::uint64_t(m_max_use) * 0x4000); int const best_effort = ftruncate(m_cache_fd, boost::uint64_t(m_max_use) * 0x4000);
TORRENT_UNUSED(best_effort);
m_cache_pool = static_cast<char*>(mmap(0, boost::uint64_t(m_max_use) * 0x4000, PROT_READ | PROT_WRITE m_cache_pool = static_cast<char*>(mmap(0, boost::uint64_t(m_max_use) * 0x4000, PROT_READ | PROT_WRITE
, MAP_SHARED | MAP_NOCACHE, m_cache_fd, 0)); , MAP_SHARED | MAP_NOCACHE, m_cache_fd, 0));
if (intptr_t(m_cache_pool) == -1) if (intptr_t(m_cache_pool) == -1)
@ -492,7 +495,8 @@ namespace libtorrent
m_cache_pool = 0; m_cache_pool = 0;
// attempt to make MacOS not flush this to disk, making close() // attempt to make MacOS not flush this to disk, making close()
// block for a long time // block for a long time
ftruncate(m_cache_fd, 0); int const best_effort = ftruncate(m_cache_fd, 0);
TORRENT_UNUSED(best_effort);
close(m_cache_fd); close(m_cache_fd);
m_cache_fd = -1; m_cache_fd = -1;
} }