[pkg-fso-commits] [SCM] Automatic Display Manager branch, bug540201, updated. debian/0.6-1-33-gf7b8979

Enrico Zini enrico at enricozini.org
Tue Jul 5 17:45:57 UTC 2011


The following commit has been merged in the bug540201 branch:
commit f7b8979cfdae39bbaa18b612750e6ad5c6f64a5a
Author: Enrico Zini <enrico at enricozini.org>
Date:   Tue Jul 5 19:45:55 2011 +0200

    Made child session body overridable for tests

diff --git a/xsession.c b/xsession.c
index 316f81c..ff5793a 100644
--- a/xsession.c
+++ b/xsession.c
@@ -34,6 +34,7 @@
 
 int nodm_xsession_init(struct nodm_xsession* s)
 {
+    s->child_body = NULL;
     s->conf_use_pam = true;
     s->conf_cleanup_xse = true;
 
@@ -105,7 +106,9 @@ int nodm_xsession_start(struct nodm_xsession* s, struct nodm_xserver* srv)
     if (s->pid == 0)
     {
         // child shell */
-        if (s->conf_use_pam)
+        if (s->child_body)
+            exit(s->child_body(&child));
+        else if (s->conf_use_pam)
             exit(nodm_xsession_child_pam(&child));
         else
             exit(nodm_xsession_child(&child));
diff --git a/xsession.h b/xsession.h
index a960bbb..759c56b 100644
--- a/xsession.h
+++ b/xsession.h
@@ -25,6 +25,7 @@
 #include <sys/types.h>
 
 struct nodm_xserver;
+struct nodm_xsession_child;
 
 /// Supervise an X session
 struct nodm_xsession
@@ -47,6 +48,9 @@ struct nodm_xsession
 
     /// X session pid
     pid_t pid;
+
+    /// If non-NULL, use as child process main body (used for tests)
+    int (*child_body)(struct nodm_xsession_child* s);
 };
 
 /// Initialise a struct nodm_session with default values

-- 
Automatic Display Manager



More information about the pkg-fso-commits mailing list