From bc1e47a486a4f52e59a57c7f4508e06823f36e9a Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 4 Sep 2011 23:29:47 +0000 Subject: [PATCH] solaris fixes --- Jamfile | 5 +++++ include/libtorrent/config.hpp | 1 + include/libtorrent/storage.hpp | 6 +----- src/file.cpp | 5 +++++ src/storage.cpp | 6 ++++++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Jamfile b/Jamfile index 106f8c9f4..4a17e54f4 100755 --- a/Jamfile +++ b/Jamfile @@ -171,8 +171,10 @@ rule linking ( properties * ) { # on mac the boost headers are installed in # a directory that isn't automatically accessable + # on open indiana, boost is install at /usr/g++/include result += /opt/local/include/boost-1_35 /opt/local/include + /usr/g++/include ; } @@ -353,10 +355,13 @@ local boost-library-search-path = /usr/lib /usr/local/lib /sw/lib + /usr/g++/lib ; lib boost_system : : darwin boost_system-mt $(boost-library-search-path) ; +lib boost_system : : solaris boost_system $(boost-library-search-path) ; + lib boost_system : : boost_system ; # openssl on linux/bsd/macos etc. diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index 6015fff37..e46eb4c55 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -197,6 +197,7 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_SOLARIS #define TORRENT_COMPLETE_TYPES_REQUIRED 1 #define TORRENT_USE_IFCONF 1 +#define TORRENT_HAS_SALEN 0 // ==== BEOS === #elif defined __BEOS__ || defined __HAIKU__ diff --git a/include/libtorrent/storage.hpp b/include/libtorrent/storage.hpp index 08aad67e5..6ce78c3a8 100644 --- a/include/libtorrent/storage.hpp +++ b/include/libtorrent/storage.hpp @@ -166,11 +166,7 @@ namespace libtorrent disk_buffer_pool* disk_pool() { return m_disk_pool; } session_settings const& settings() const { return *m_settings; } - void set_error(std::string const& file, error_code const& ec) const - { - m_error_file = file; - m_error = ec; - } + void set_error(std::string const& file, error_code const& ec) const; error_code const& error() const { return m_error; } std::string const& error_file() const { return m_error_file; } diff --git a/src/file.cpp b/src/file.cpp index ea5772c85..8d2ce3838 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -211,6 +211,10 @@ namespace libtorrent void create_directories(std::string const& f, error_code& ec) { ec.clear(); + if (is_directory(f, ec)) return; + if (ec != boost::system::errc::no_such_file_or_directory) + return; + ec.clear(); if (is_root_path(f)) return; if (has_parent_path(f)) { @@ -1758,6 +1762,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER { // this is supported on solaris size_type ret = lseek(m_fd, start, SEEK_DATA); if (ret < 0) return start; + return start; #else return start; #endif diff --git a/src/storage.cpp b/src/storage.cpp index c11eae6b1..e18800de1 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -246,6 +246,12 @@ namespace libtorrent return true; } + void storage_interface::set_error(std::string const& file, error_code const& ec) const + { + m_error_file = file; + m_error = ec; + } + // for backwards compatibility, let the default readv and // writev implementations be implemented in terms of the // old read and write