let CMake check for umask()
[quassel.git] / src / core / core.cpp
index 2a2e5eb..6dc4fa7 100644 (file)
 #  include <termios.h>
 #endif /* Q_OS_WIN32 */
 
-// umask
-#ifndef Q_OS_WIN32
+#ifdef HAVE_UMASK
 #  include <sys/types.h>
 #  include <sys/stat.h>
-#endif /* Q_OS_WIN32 */
+#endif /* HAVE_UMASK */
 
 // ==============================
 //  Custom Events
@@ -80,9 +79,9 @@ void Core::destroy() {
 Core::Core()
   : _storage(0)
 {
-#ifndef Q_OS_WIN32
+#ifdef HAVE_UMASK
   umask(S_IRWXG | S_IRWXO);
-#endif /* Q_OS_WIN32 */
+#endif
   _startTime = QDateTime::currentDateTime().toUTC();  // for uptime :)
 
   Quassel::loadTranslation(QLocale::system());
@@ -169,8 +168,6 @@ Core::Core()
 }
 
 void Core::init() {
-  _oidentdConfigGenerator = new OidentdConfigGenerator();
-
   CoreSettings cs;
   _configured = initStorage(cs.storageSettings().toMap());
 
@@ -203,6 +200,9 @@ void Core::init() {
   connect(&_server, SIGNAL(newConnection()), this, SLOT(incomingConnection()));
   connect(&_v6server, SIGNAL(newConnection()), this, SLOT(incomingConnection()));
   if(!startListening()) exit(1); // TODO make this less brutal
+
+  if(Quassel::isOptionSet("oidentd"))
+    _oidentdConfigGenerator = new OidentdConfigGenerator(this);
 }
 
 Core::~Core() {