forked from premiere/premiere-libtorrent
solaris build fixes
This commit is contained in:
parent
cc3c515458
commit
9fd624ecb6
|
@ -1551,8 +1551,9 @@ namespace libtorrent
|
|||
}
|
||||
#endif // F_PREALLOCATE
|
||||
|
||||
int ret;
|
||||
#if defined TORRENT_LINUX
|
||||
int ret = my_fallocate(m_fd, 0, 0, s);
|
||||
ret = my_fallocate(m_fd, 0, 0, s);
|
||||
// if we return 0, everything went fine
|
||||
// the fallocate call succeeded
|
||||
if (ret == 0) return true;
|
||||
|
|
|
@ -364,7 +364,7 @@ int start_tracker()
|
|||
stop_tracker();
|
||||
|
||||
{
|
||||
mutex::scoped_lock l(tracker_lock);
|
||||
libtorrent::mutex::scoped_lock l(tracker_lock);
|
||||
tracker_initialized.clear(l);
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,7 @@ int start_tracker()
|
|||
tracker_server.reset(new libtorrent::thread(boost::bind(&udp_tracker_thread, &port)));
|
||||
|
||||
{
|
||||
mutex::scoped_lock l(tracker_lock);
|
||||
libtorrent::mutex::scoped_lock l(tracker_lock);
|
||||
tracker_initialized.wait(l);
|
||||
}
|
||||
test_sleep(100);
|
||||
|
@ -438,7 +438,7 @@ void udp_tracker_thread(int* port)
|
|||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "Error opening listen UDP socket: %s\n", ec.message().c_str());
|
||||
mutex::scoped_lock l(tracker_lock);
|
||||
libtorrent::mutex::scoped_lock l(tracker_lock);
|
||||
tracker_initialized.signal(l);
|
||||
return;
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ void udp_tracker_thread(int* port)
|
|||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "Error binding UDP socket to port 0: %s\n", ec.message().c_str());
|
||||
mutex::scoped_lock l(tracker_lock);
|
||||
libtorrent::mutex::scoped_lock l(tracker_lock);
|
||||
tracker_initialized.signal(l);
|
||||
return;
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ void udp_tracker_thread(int* port)
|
|||
fprintf(stderr, "UDP tracker initialized on port %d\n", *port);
|
||||
|
||||
{
|
||||
mutex::scoped_lock l(tracker_lock);
|
||||
libtorrent::mutex::scoped_lock l(tracker_lock);
|
||||
tracker_initialized.signal(l);
|
||||
}
|
||||
|
||||
|
@ -477,7 +477,7 @@ void udp_tracker_thread(int* port)
|
|||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "Error receiving on UDP socket: %s\n", ec.message().c_str());
|
||||
mutex::scoped_lock l(tracker_lock);
|
||||
libtorrent::mutex::scoped_lock l(tracker_lock);
|
||||
tracker_initialized.signal(l);
|
||||
return;
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ int start_web_server(bool ssl)
|
|||
stop_web_server();
|
||||
|
||||
{
|
||||
mutex::scoped_lock l(web_lock);
|
||||
libtorrent::mutex::scoped_lock l(web_lock);
|
||||
web_initialized.clear(l);
|
||||
}
|
||||
|
||||
|
@ -517,7 +517,7 @@ int start_web_server(bool ssl)
|
|||
web_server.reset(new libtorrent::thread(boost::bind(&web_server_thread, &port, ssl)));
|
||||
|
||||
{
|
||||
mutex::scoped_lock l(web_lock);
|
||||
libtorrent::mutex::scoped_lock l(web_lock);
|
||||
web_initialized.wait(l);
|
||||
}
|
||||
|
||||
|
@ -571,7 +571,7 @@ void web_server_thread(int* port, bool ssl)
|
|||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "Error opening listen socket: %s\n", ec.message().c_str());
|
||||
mutex::scoped_lock l(web_lock);
|
||||
libtorrent::mutex::scoped_lock l(web_lock);
|
||||
web_initialized.signal(l);
|
||||
return;
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ void web_server_thread(int* port, bool ssl)
|
|||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "Error setting listen socket to reuse addr: %s\n", ec.message().c_str());
|
||||
mutex::scoped_lock l(web_lock);
|
||||
libtorrent::mutex::scoped_lock l(web_lock);
|
||||
web_initialized.signal(l);
|
||||
return;
|
||||
}
|
||||
|
@ -587,7 +587,7 @@ void web_server_thread(int* port, bool ssl)
|
|||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "Error binding listen socket to port 0: %s\n", ec.message().c_str());
|
||||
mutex::scoped_lock l(web_lock);
|
||||
libtorrent::mutex::scoped_lock l(web_lock);
|
||||
web_initialized.signal(l);
|
||||
return;
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ void web_server_thread(int* port, bool ssl)
|
|||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "Error listening on socket: %s\n", ec.message().c_str());
|
||||
mutex::scoped_lock l(web_lock);
|
||||
libtorrent::mutex::scoped_lock l(web_lock);
|
||||
web_initialized.signal(l);
|
||||
return;
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ void web_server_thread(int* port, bool ssl)
|
|||
fprintf(stderr, "web server initialized on port %d\n", *port);
|
||||
|
||||
{
|
||||
mutex::scoped_lock l(web_lock);
|
||||
libtorrent::mutex::scoped_lock l(web_lock);
|
||||
web_initialized.signal(l);
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ struct test_storage : storage_interface
|
|||
{
|
||||
if (slot == 0 || slot == 5999)
|
||||
{
|
||||
mutex::scoped_lock l(m_mutex);
|
||||
libtorrent::mutex::scoped_lock l(m_mutex);
|
||||
std::cerr << "--- starting job " << slot << " waiting for main thread ---\n" << std::endl;
|
||||
m_ready = true;
|
||||
m_ready_condition.signal(l);
|
||||
|
@ -200,14 +200,14 @@ struct test_storage : storage_interface
|
|||
|
||||
void wait_for_ready()
|
||||
{
|
||||
mutex::scoped_lock l(m_mutex);
|
||||
libtorrent::mutex::scoped_lock l(m_mutex);
|
||||
while (!m_ready)
|
||||
m_ready_condition.wait(l);
|
||||
}
|
||||
|
||||
void start()
|
||||
{
|
||||
mutex::scoped_lock l(m_mutex);
|
||||
libtorrent::mutex::scoped_lock l(m_mutex);
|
||||
m_started = true;
|
||||
m_condition.signal(l);
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ struct test_storage : storage_interface
|
|||
private:
|
||||
condition m_ready_condition;
|
||||
condition m_condition;
|
||||
mutex m_mutex;
|
||||
libtorrent::mutex m_mutex;
|
||||
bool m_started;
|
||||
bool m_ready;
|
||||
|
||||
|
@ -470,7 +470,7 @@ void run_storage_tests(boost::intrusive_ptr<torrent_info> info
|
|||
boost::shared_ptr<int> dummy(new int);
|
||||
boost::intrusive_ptr<piece_manager> pm = new piece_manager(dummy, info
|
||||
, test_path, fp, io, default_storage_constructor, storage_mode);
|
||||
mutex lock;
|
||||
libtorrent::mutex lock;
|
||||
|
||||
error_code ec;
|
||||
bool done = false;
|
||||
|
@ -696,7 +696,7 @@ void test_check_files(std::string const& test_path
|
|||
boost::shared_ptr<int> dummy(new int);
|
||||
boost::intrusive_ptr<piece_manager> pm = new piece_manager(dummy, info
|
||||
, test_path, fp, io, default_storage_constructor, storage_mode);
|
||||
mutex lock;
|
||||
libtorrent::mutex lock;
|
||||
|
||||
bool done = false;
|
||||
lazy_entry frd;
|
||||
|
|
Loading…
Reference in New Issue