From 190d7f1a3db4980eace56f17d30d3ce65bae44b2 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Mon, 11 Jan 2010 01:55:34 +0000 Subject: fixed line indention fixed signal controler init position --- src/anytun.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/anytun.cpp b/src/anytun.cpp index 222adf6..e7afbd5 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -410,7 +410,7 @@ int main(int argc, char* argv[]) // daemonizing has to done before any thread gets started #ifndef NO_DAEMON #ifndef NO_PRIVDROP - PrivInfo privs(gOpt.getUsername(), gOpt.getGroupname()); + PrivInfo privs(gOpt.getUsername(), gOpt.getGroupname()); #endif if(gOpt.getDaemonize()) { daemonize(); @@ -430,29 +430,29 @@ int main(int argc, char* argv[]) StringVector args = boost::assign::list_of(dev.getActualName())(dev.getActualNode()); postup_script = new SysExec(gOpt.getPostUpScript(), args); } -#endif - // this has to be called before the first thread is started -#if !( defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) - gSignalController.init(); #endif #ifndef NO_DAEMON - if(gOpt.getChrootDir() != "") { - try { - do_chroot(gOpt.getChrootDir()); - } - catch(const std::runtime_error& e) { - cLog.msg(Log::PRIO_WARNING) << "ignoring chroot error: " << e.what(); + if(gOpt.getChrootDir() != "") { + try { + do_chroot(gOpt.getChrootDir()); + } + catch(const std::runtime_error& e) { + cLog.msg(Log::PRIO_WARNING) << "ignoring chroot error: " << e.what(); + } } - } #ifndef NO_PRIVDROP - privs.drop(); + privs.drop(); +#endif #endif +#if !( defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) + // this has to be called before the first thread is started + gSignalController.init(); #endif gResolver.init(); #ifndef NO_EXEC - boost::thread(boost::bind(&TunDevice::waitForPostUpScript,&dev)); - if (postup_script) - boost::thread(boost::bind(&SysExec::waitForScript,postup_script)); + boost::thread(boost::bind(&TunDevice::waitForPostUpScript,&dev)); + if (postup_script) + boost::thread(boost::bind(&SysExec::waitForScript,postup_script)); #endif #ifndef NO_CRYPT #ifndef USE_SSL_CRYPTO -- cgit v1.2.3