Browse Source

Fix tty slowness

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@181 7c53e7cc-98ea-0310-8f1f-a0b24da60408
iwamatsu 12 years ago
parent
commit
ff3ae31bc6
1 changed files with 6 additions and 4 deletions
  1. 6 4
      app.cpp

+ 6 - 4
app.cpp

@@ -278,21 +278,23 @@ void App::Run() {
         signal(SIGALRM, AlarmSignal);
 
 #ifndef XNEST_DEBUG
-        OpenLog();
-        
         if (!force_nodaemon && cfg->getOption("daemon") == "yes") {
             daemonmode = true;
         }
 
         // Daemonize
         if (daemonmode) {
-            if (daemon(0, 1) == -1) {
+            if (daemon(0, 0) == -1) {
                 cerr << APPNAME << ": " << strerror(errno) << endl;
                 exit(ERR_EXIT);
             }
-            UpdatePid();
         }
 
+        OpenLog();
+
+        if (daemonmode)
+            UpdatePid();
+
         CreateServerAuth();
         StartServer();
         alarm(2);