forked from premiere/premiere-libtorrent
fixed BSD file allocation issue
This commit is contained in:
parent
abec8aed8c
commit
a7b8ae9e27
|
@ -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
|
||||
|
|
14
src/file.cpp
14
src/file.cpp
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue