fix move_storage error handling bug (#638)

This commit is contained in:
Arvid Norberg 2016-04-23 10:02:52 -04:00
parent ed5673bf5c
commit a9f07a29bd
1 changed files with 5 additions and 3 deletions

View File

@ -1179,16 +1179,18 @@ namespace libtorrent
stat_file(save_path, &s, e);
if (e == boost::system::errc::no_such_file_or_directory)
{
create_directories(save_path, ec.ec);
if (ec)
create_directories(save_path, e);
if (e)
{
ec.ec = e;
ec.file = -1;
ec.operation = storage_error::mkdir;
return piece_manager::fatal_disk_error;
}
}
else if (ec)
else if (e)
{
ec.ec = e;
ec.file = -1;
ec.operation = storage_error::mkdir;
return piece_manager::fatal_disk_error;