From 29fb79f60c7d71740e0aee1e214d1c38334a35b9 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 24 Nov 2014 04:25:05 +0000 Subject: [PATCH] merged changes from RC_1_0 --- examples/client_test.cpp | 21 ++++++++++++++++++--- include/libtorrent/allocator.hpp | 2 ++ tools/clean.py | 6 +++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 894ed06d4..650b4664d 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -634,7 +634,8 @@ void add_torrent(libtorrent::session& ses } std::vector list_dir(std::string path - , bool (*filter_fun)(std::string const&)) + , bool (*filter_fun)(std::string const&) + , libtorrent::error_code& ec) { std::vector ret; #ifdef TORRENT_WINDOWS @@ -647,7 +648,10 @@ std::vector list_dir(std::string path WIN32_FIND_DATAW fd; HANDLE handle = FindFirstFileW(wpath.c_str(), &fd); if (handle == INVALID_HANDLE_VALUE) + { + ec.assign(GetLastError(), boost::system::sytem_category()); return ret; + } do { @@ -664,7 +668,11 @@ std::vector list_dir(std::string path path.resize(path.size()-1); DIR* handle = opendir(path.c_str()); - if (handle == 0) return ret; + if (handle == 0) + { + ec.assign(errno, boost::system::generic_category()); + return ret; + } struct dirent de; dirent* dummy; @@ -676,6 +684,7 @@ std::vector list_dir(std::string path if (filter_fun(p)) ret.push_back(p); } + closedir(handle); #endif return ret; } @@ -708,7 +717,13 @@ void scan_dir(std::string const& dir_path using namespace libtorrent; error_code ec; - std::vector ents = list_dir(dir_path, filter_fun); + std::vector ents = list_dir(dir_path, filter_fun, ec); + if (ec) + { + fprintf(stderr, "failed to list directory: (%s : %d) %s\n" + , ec.category().name(), ec.value(), ec.message().c_str()); + return; + } for (std::vector::iterator i = ents.begin() , end(ents.end()); i != end; ++i) diff --git a/include/libtorrent/allocator.hpp b/include/libtorrent/allocator.hpp index 4cf9e937d..aee5569bb 100644 --- a/include/libtorrent/allocator.hpp +++ b/include/libtorrent/allocator.hpp @@ -71,6 +71,8 @@ namespace libtorrent h.m_buf = tmp; } private: + aligned_holder(aligned_holder const&); + aligned_holder& operator=(aligned_holder const&); char* m_buf; }; diff --git a/tools/clean.py b/tools/clean.py index 5e8c4e04f..7874d0d72 100644 --- a/tools/clean.py +++ b/tools/clean.py @@ -15,7 +15,10 @@ def clean(): 'bjam_build.*.xml' '*.exe', '*.pdb', - '*.pyd' + '*.pyd', + 'dist', + 'build', + '.libs' ] directories = [ @@ -23,6 +26,7 @@ def clean(): 'test', '.', 'tools', + 'src', os.path.join('bindings', 'python') ]