fixed BSD file allocation issue

This commit is contained in:
Arvid Norberg 2011-04-13 06:54:56 +00:00
parent abec8aed8c
commit a7b8ae9e27
2 changed files with 13 additions and 2 deletions

View File

@ -85,6 +85,7 @@
incoming connection
* added more detailed instrumentation of the disk I/O thread
* fixed BSD file allocation issue
* fixed bug in session::delete_files option to remove_torrent
0.15.6 release

View File

@ -1579,8 +1579,18 @@ namespace libtorrent
fstore_t f = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, s, 0};
if (fcntl(m_fd, F_PREALLOCATE, &f) < 0)
{
ec.assign(errno, get_posix_category());
return false;
if (errno != ENOSPC)
{
ec.assign(errno, get_posix_category());
return false;
}
// ok, let's try to allocate non contiguous space then
fstore_t f = {F_ALLOCATEALL, F_PEOFPOSMODE, 0, s, 0};
if (fcntl(m_fd, F_PREALLOCATE, &f) < 0)
{
ec.assign(errno, get_posix_category());
return false;
}
}
#endif // F_PREALLOCATE