fall back to copy+remove if rename_file fails

This commit is contained in:
Arvid Norberg 2018-08-19 16:35:10 +02:00 committed by Arvid Norberg
parent 6e80f1f615
commit c1b0c70c23
2 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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)
{