forked from premiere/premiere-libtorrent
fall back to copy+remove if rename_file fails
This commit is contained in:
parent
6e80f1f615
commit
c1b0c70c23
|
@ -1,3 +1,4 @@
|
|||
* fall back to copy+remove if rename_file fails
|
||||
* improve handling of filesystems not supporting fallocate()
|
||||
* force-proxy no longer disables DHT
|
||||
* improve connect-boost feature, to make new torrents quickly connect peers
|
||||
|
|
|
@ -776,12 +776,21 @@ namespace libtorrent
|
|||
if (ec.ec == boost::system::errc::no_such_file_or_directory)
|
||||
ec.ec.clear();
|
||||
|
||||
if (ec)
|
||||
{
|
||||
ec.ec.clear();
|
||||
copy_file(old_name, new_path, ec.ec);
|
||||
|
||||
if (ec)
|
||||
{
|
||||
ec.file = index;
|
||||
ec.operation = storage_error::rename;
|
||||
return;
|
||||
}
|
||||
|
||||
error_code ignore;
|
||||
remove(old_name, ignore);
|
||||
}
|
||||
}
|
||||
else if (ec.ec)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue