[pkg-fso-commits] [SCM] Automatic Display Manager branch, master, updated. debian/0.8-1-10-gb645dd1

Enrico Zini enrico at enricozini.org
Fri Jul 8 23:10:52 UTC 2011


The following commit has been merged in the master branch:
commit 27046d495e3ef701ef8339248a5640b70c94b02b
Author: Enrico Zini <enrico at enricozini.org>
Date:   Sat Jul 9 00:09:12 2011 +0100

    Verbose logging tweaks

diff --git a/dm.c b/dm.c
index 0a54d13..4bd1470 100644
--- a/dm.c
+++ b/dm.c
@@ -86,7 +86,9 @@ int nodm_display_manager_start(struct nodm_display_manager* dm)
         while (*s) ++s;
         *s++ = dm->_vtarg;
         *s = NULL;
-    }
+        log_verb("allocated VT %d", dm->vt.num);
+    } else
+        log_verb("skipped VT allocation");
 
     // Block all signals
     sigset_t blockmask;
@@ -113,9 +115,11 @@ int nodm_display_manager_restart(struct nodm_display_manager* dm)
 
     int res = nodm_xserver_start(&dm->srv);
     if (res != E_SUCCESS) return res;
+    log_verb("X server is ready for connections");
 
     res = nodm_xsession_start(&dm->session, &dm->srv);
     if (res != E_SUCCESS) return res;
+    log_verb("X session has started");
 
     return E_SUCCESS;
 }
@@ -352,7 +356,7 @@ static int interruptible_sleep(int seconds)
 
 int nodm_display_manager_wait_restart_loop(struct nodm_display_manager* dm)
 {
-    static int retry_times[] = { 0, 0, 30, 30, 60, 60, -1 };
+    static int retry_times[] = { -1, 0, 0, 30, 30, 60, 60, -1 };
     int restart_count = 0;
     int res;
 
@@ -373,6 +377,8 @@ int nodm_display_manager_wait_restart_loop(struct nodm_display_manager* dm)
                 return res;
         }
 
+        return res;
+
         /* Check if the session was too short */
         if (end - dm->last_session_start < dm->conf_minimum_session_time)
         {
diff --git a/log.c b/log.c
index 9a89d78..efa3781 100644
--- a/log.c
+++ b/log.c
@@ -68,7 +68,7 @@ static void log_common(int prio, const char* fmt, va_list ap)
     }
 }
 
-void log_verbose(const char* fmt, ...)
+void log_verb(const char* fmt, ...)
 {
     if (!config->log_level < NODM_LL_VERB) return;
 
diff --git a/log.h b/log.h
index f84ff7c..2927482 100644
--- a/log.h
+++ b/log.h
@@ -73,7 +73,7 @@ void log_start(const struct log_config* conf);
 void log_end();
 
 /// Log a message about the trivial normal progress of things
-void log_verbose(const char* fmt, ...);
+void log_verb(const char* fmt, ...);
 
 /// Log a message about the relevant normal progress of things
 void log_info(const char* fmt, ...);
diff --git a/test-xstart.c b/test-xstart.c
index d017ea6..00c17a4 100644
--- a/test-xstart.c
+++ b/test-xstart.c
@@ -48,6 +48,8 @@ int main(int argc, char* argv[])
         return res;
     }
 
+    sleep(3);
+
     res = nodm_xserver_stop(&srv);
     if (res != E_SUCCESS)
     {
diff --git a/xserver.c b/xserver.c
index ff0ed4f..5e2781a 100644
--- a/xserver.c
+++ b/xserver.c
@@ -217,7 +217,7 @@ int nodm_xserver_start(struct nodm_xserver* srv)
         }
     }
 
-    log_verbose("X is ready to accept connections");
+    log_verb("X is ready to accept connections");
 
 cleanup:
     // Restore signal mask

-- 
Automatic Display Manager



More information about the pkg-fso-commits mailing list