summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/anytun.cpp8
-rw-r--r--src/keyDerivation.h6
-rw-r--r--src/resolver.h2
-rw-r--r--src/signalController.cpp11
-rw-r--r--src/signalController.h2
5 files changed, 16 insertions, 13 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index eaa83ff..98bebb0 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -396,6 +396,10 @@ int main(int argc, char* argv[])
cLog.msg(Log::PRIO_NOTICE) << "anytun started...";
gOpt.parse_post(); // print warnings
+#ifndef NO_SIGNALCONTROLLER
+ // this has to be called before the first thread is started
+ gSignalController.init();
+#endif
gResolver.init();
#ifndef NO_DAEMON
@@ -478,10 +482,6 @@ int main(int argc, char* argv[])
}
#endif
-#ifndef NO_SIGNALCONTROLLER
- gSignalController.init();
-#endif
-
OptionHost* connTo = new OptionHost();
ThreadParam p(dev, *src, *connTo);
diff --git a/src/keyDerivation.h b/src/keyDerivation.h
index 7242996..8318609 100644
--- a/src/keyDerivation.h
+++ b/src/keyDerivation.h
@@ -111,7 +111,11 @@ protected:
SharedMutex mutex_;
};
-BOOST_IS_ABSTRACT(KeyDerivation)
+#if BOOST_VERSION <= 103500
+BOOST_IS_ABSTRACT(KeyDerivation);
+#else
+BOOST_SERIALIZATION_ASSUME_ABSTRACT(KeyDerivation);
+#endif
//****** NullKeyDerivation ******
diff --git a/src/resolver.h b/src/resolver.h
index 96617f2..6bf969c 100644
--- a/src/resolver.h
+++ b/src/resolver.h
@@ -60,7 +60,7 @@ public:
static Resolver& instance();
void init();
- /*static */void run(/*void* s*/);
+ void run();
void resolveUdp(const std::string& addr, const std::string& port, boost::function<void (boost::asio::ip::udp::endpoint)> const& onResolve);
void resolveTcp(const std::string& addr, const std::string& port, boost::function<void (boost::asio::ip::tcp::endpoint)> const& onResolve);
diff --git a/src/signalController.cpp b/src/signalController.cpp
index 39748c2..12893ca 100644
--- a/src/signalController.cpp
+++ b/src/signalController.cpp
@@ -151,9 +151,8 @@ SignalController::~SignalController()
}
#ifndef _MSC_VER
-void SignalController::handle(void *s)
+void SignalController::handle()
{
- SignalController* self = reinterpret_cast<SignalController*>(s);
sigset_t signal_set;
int sigNum;
@@ -162,10 +161,10 @@ void SignalController::handle(void *s)
sigfillset(&signal_set);
sigwait(&signal_set, &sigNum);
{
- Lock(self->sigQueueMutex);
- self->sigQueue.push(sigNum);
+ Lock lock(sigQueueMutex);
+ sigQueue.push(sigNum);
}
- self->sigQueueSem.up();
+ sigQueueSem.up();
}
}
#else
@@ -194,7 +193,7 @@ void SignalController::init()
#error The signalhandler works only with pthreads
#endif
- thread = new boost::thread(boost::bind(handle, this));
+ thread = new boost::thread(boost::bind(&SignalController::handle, this));
handler[SIGINT] = new SigIntHandler;
handler[SIGQUIT] = new SigQuitHandler;
diff --git a/src/signalController.h b/src/signalController.h
index 6b8a92a..835e0fe 100644
--- a/src/signalController.h
+++ b/src/signalController.h
@@ -144,7 +144,7 @@ class SignalController
public:
static SignalController& instance();
#ifndef _MSC_VER
- static void handle(void* s);
+ void handle();
#else
static bool handle(DWORD ctrlType);
#endif