fix typo in move_storage

This commit is contained in:
Arvid Norberg 2013-05-11 21:32:18 +00:00
parent c773e67c6a
commit 01c8c8543b
2 changed files with 2 additions and 1 deletions

View File

@ -2241,7 +2241,7 @@ namespace libtorrent
#endif
TORRENT_ASSERT(j.buffer == 0);
ret = j.storage->move_storage_impl(j.str, j.piece);
if (ret != piece_manager::file_exist)
if (ret == piece_manager::file_exist)
{
j.error = error_code(boost::system::errc::file_exists, get_system_category());
j.error_file = -1;

View File

@ -144,6 +144,7 @@ void on_move_storage_exist(int ret, bool* done, disk_io_job const& j, std::strin
std::cerr << "on_move_storage_exist ret: " << ret << " path: " << j.str << std::endl;
TEST_EQUAL(ret, piece_manager::file_exist);
TEST_EQUAL(j.str, path);
TEST_EQUAL(j.error, error_code(boost::system::errc::file_exists, get_system_category()));
*done = true;
}