summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorBrian Cameron <Brian.Cameron@sun.com>2009-11-09 14:14:51 -0600
committerBrian Cameron <Brian.Cameron@sun.com>2009-11-09 14:14:51 -0600
commitf5b2931ffab26995970ebbbe0af2fafd985753a1 (patch)
tree1325364e70daf55c46a5b3c60f6ad61df948516f /daemon
parent63ce2462db5d6b1cce8f420046b2bcf079de3f2f (diff)
downloadgdm-f5b2931ffab26995970ebbbe0af2fafd985753a1.tar.gz
Fix GDM debugging so that it works. Now debugging is enabled via the
debug/Enable key in the custom.conf file. See bug #596831.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/factory-slave-main.c29
-rw-r--r--daemon/main.c18
-rw-r--r--daemon/product-slave-main.c29
-rw-r--r--daemon/session-worker-main.c29
-rw-r--r--daemon/simple-slave-main.c15
-rw-r--r--daemon/xdmcp-chooser-slave-main.c13
6 files changed, 102 insertions, 31 deletions
diff --git a/daemon/factory-slave-main.c b/daemon/factory-slave-main.c
index d8a13381..8a99749f 100644
--- a/daemon/factory-slave-main.c
+++ b/daemon/factory-slave-main.c
@@ -44,7 +44,12 @@
#include "gdm-common.h"
#include "gdm-factory-slave.h"
-static int gdm_return_code = 0;
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
+
+static GdmSettings *settings = NULL;
+static int gdm_return_code = 0;
static DBusGConnection *
get_system_bus (void)
@@ -145,14 +150,17 @@ on_slave_stopped (GdmSlave *slave,
}
static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
{
+ gboolean debug = FALSE;
+
/* enable debugging for unstable builds */
if (gdm_is_version_unstable ()) {
return TRUE;
}
- return arg;
+ gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+ return debug;
}
int
@@ -164,10 +172,8 @@ main (int argc,
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
- static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
- { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("ID") },
{ NULL }
};
@@ -193,7 +199,18 @@ main (int argc,
gdm_log_init ();
- gdm_log_set_debug (is_debug_set (debug));
+ settings = gdm_settings_new ();
+ if (settings == NULL) {
+ g_warning ("Unable to initialize settings");
+ exit (1);
+ }
+
+ if (! gdm_settings_direct_init (settings, GDMCONFDIR "/gdm.schemas", "/")) {
+ g_warning ("Unable to initialize settings");
+ exit (1);
+ }
+
+ gdm_log_set_debug (is_debug_set ());
if (display_id == NULL) {
g_critical ("No display ID set");
diff --git a/daemon/main.c b/daemon/main.c
index 5bb407af..cfc3655a 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -499,6 +499,20 @@ signal_cb (int signo,
return ret;
}
+static gboolean
+is_debug_set (void)
+{
+ gboolean debug = FALSE;
+
+ /* enable debugging for unstable builds */
+ if (gdm_is_version_unstable ()) {
+ return TRUE;
+ }
+
+ gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+ return debug;
+}
+
int
main (int argc,
char **argv)
@@ -512,12 +526,10 @@ main (int argc,
gboolean res;
gboolean xdmcp_enabled;
GdmSignalHandler *signal_handler;
- static gboolean debug = FALSE;
static gboolean do_timed_exit = FALSE;
static gboolean print_version = FALSE;
static gboolean fatal_warnings = FALSE;
static GOptionEntry entries [] = {
- { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &fatal_warnings, N_("Make all warnings fatal"), NULL },
{ "timed-exit", 0, 0, G_OPTION_ARG_NONE, &do_timed_exit, N_("Exit after a time - for debugging"), NULL },
{ "version", 0, 0, G_OPTION_ARG_NONE, &print_version, N_("Print GDM version"), NULL },
@@ -585,7 +597,7 @@ main (int argc,
goto out;
}
- gdm_log_set_debug (debug);
+ gdm_log_set_debug (is_debug_set ());
gdm_daemon_change_user (&gdm_uid, &gdm_gid);
gdm_daemon_check_permissions (gdm_uid, gdm_gid);
diff --git a/daemon/product-slave-main.c b/daemon/product-slave-main.c
index 3072648d..b696ad2e 100644
--- a/daemon/product-slave-main.c
+++ b/daemon/product-slave-main.c
@@ -44,7 +44,12 @@
#include "gdm-common.h"
#include "gdm-product-slave.h"
-static int gdm_return_code = 0;
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
+
+static GdmSettings *settings = NULL;
+static int gdm_return_code = 0;
static DBusGConnection *
get_system_bus (void)
@@ -149,14 +154,17 @@ on_slave_stopped (GdmSlave *slave,
}
static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
{
+ gboolean debug = FALSE;
+
/* enable debugging for unstable builds */
if (gdm_is_version_unstable ()) {
return TRUE;
}
- return arg;
+ gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+ return debug;
}
int
@@ -168,10 +176,8 @@ main (int argc,
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
- static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
- { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("ID") },
{ NULL }
};
@@ -197,7 +203,18 @@ main (int argc,
gdm_log_init ();
- gdm_log_set_debug (is_debug_set (debug));
+ settings = gdm_settings_new ();
+ if (settings == NULL) {
+ g_warning ("Unable to initialize settings");
+ goto out;
+ }
+
+ if (! gdm_settings_direct_init (settings, GDMCONFDIR "/gdm.schemas", "/")) {
+ g_warning ("Unable to initialize settings");
+ goto out;
+ }
+
+ gdm_log_set_debug (is_debug_set ());
if (display_id == NULL) {
g_critical ("No display ID set");
diff --git a/daemon/session-worker-main.c b/daemon/session-worker-main.c
index 6709cbeb..babe827f 100644
--- a/daemon/session-worker-main.c
+++ b/daemon/session-worker-main.c
@@ -44,9 +44,15 @@
#include "gdm-log.h"
#include "gdm-session-worker.h"
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
+
#define SERVER_DBUS_PATH "/org/gnome/DisplayManager/SessionServer"
#define SERVER_DBUS_INTERFACE "org.gnome.DisplayManager.SessionServer"
+static GdmSettings *settings = NULL;
+
static gboolean
signal_cb (int signo,
gpointer data)
@@ -113,14 +119,17 @@ signal_cb (int signo,
}
static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
{
+ gboolean debug = FALSE;
+
/* enable debugging for unstable builds */
if (gdm_is_version_unstable ()) {
return TRUE;
}
- return arg;
+ gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+ return debug;
}
int
@@ -132,9 +141,7 @@ main (int argc,
GdmSessionWorker *worker;
GdmSignalHandler *signal_handler;
const char *address;
- static gboolean debug = FALSE;
static GOptionEntry entries [] = {
- { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ NULL }
};
@@ -153,7 +160,19 @@ main (int argc,
g_option_context_free (context);
gdm_log_init ();
- gdm_log_set_debug (is_debug_set (debug));
+
+ settings = gdm_settings_new ();
+ if (settings == NULL) {
+ g_warning ("Unable to initialize settings");
+ exit (1);
+ }
+
+ if (! gdm_settings_direct_init (settings, GDMCONFDIR "/gdm.schemas", "/")) {
+ g_warning ("Unable to initialize settings");
+ exit (1);
+ }
+
+ gdm_log_set_debug (is_debug_set ());
address = g_getenv ("GDM_SESSION_DBUS_ADDRESS");
if (address == NULL) {
diff --git a/daemon/simple-slave-main.c b/daemon/simple-slave-main.c
index b8926d8b..629f004b 100644
--- a/daemon/simple-slave-main.c
+++ b/daemon/simple-slave-main.c
@@ -46,7 +46,9 @@
#include "gdm-settings.h"
#include "gdm-settings-direct.h"
-#include "gdm-settings-client.h"
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
static GdmSettings *settings = NULL;
static int gdm_return_code = 0;
@@ -154,14 +156,17 @@ on_slave_stopped (GdmSlave *slave,
}
static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
{
+ gboolean debug = FALSE;
+
/* enable debugging for unstable builds */
if (gdm_is_version_unstable ()) {
return TRUE;
}
- return arg;
+ gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+ return debug;
}
int
@@ -173,10 +178,8 @@ main (int argc,
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
- static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
- { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("ID") },
{ NULL }
};
@@ -216,7 +219,7 @@ main (int argc,
goto out;
}
- gdm_log_set_debug (is_debug_set (debug));
+ gdm_log_set_debug (is_debug_set ());
if (display_id == NULL) {
g_critical ("No display ID set");
diff --git a/daemon/xdmcp-chooser-slave-main.c b/daemon/xdmcp-chooser-slave-main.c
index b875bfcd..a35c978e 100644
--- a/daemon/xdmcp-chooser-slave-main.c
+++ b/daemon/xdmcp-chooser-slave-main.c
@@ -43,8 +43,10 @@
#include "gdm-log.h"
#include "gdm-common.h"
#include "gdm-xdmcp-chooser-slave.h"
+
#include "gdm-settings.h"
#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
static GdmSettings *settings = NULL;
static int gdm_return_code = 0;
@@ -154,14 +156,17 @@ on_slave_stopped (GdmSlave *slave,
}
static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
{
+ gboolean debug = FALSE;
+
/* enable debugging for unstable builds */
if (gdm_is_version_unstable ()) {
return TRUE;
}
- return arg;
+ gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+ return debug;
}
int
@@ -173,10 +178,8 @@ main (int argc,
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
- static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
- { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("ID") },
{ NULL }
};
@@ -213,7 +216,7 @@ main (int argc,
goto out;
}
- gdm_log_set_debug (is_debug_set (debug));
+ gdm_log_set_debug (is_debug_set ());
if (display_id == NULL) {
g_critical ("No display ID set");