fix partfile on windows

This commit is contained in:
Arvid Norberg 2015-01-15 03:35:13 +00:00
parent ce80e8c0c1
commit 9bfbb8a52a
2 changed files with 5 additions and 1 deletions

View File

@ -350,6 +350,8 @@ namespace libtorrent
if (m_piece_map.empty())
{
m_file.close();
// if we don't have any pieces left in the
// part file, remove it
std::string p = combine_path(m_path, m_name);

View File

@ -126,7 +126,9 @@ int test_main()
// we just removed the last piece. The partfile does not
// contain anything anymore, it should have deleted itself
TEST_CHECK(!exists(combine_path(combine_path(cwd, "partfile_test_dir2"), "partfile.parts")));
TEST_CHECK(!exists(combine_path(combine_path(cwd, "partfile_test_dir2"), "partfile.parts"), ec));
TEST_CHECK(!ec);
if (ec) fprintf(stderr, "exists: %s\n", ec.message().c_str());
output.close();