aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2012-03-18 23:01:51 -0400
committerAlexandre Rostovtsev <tetromino@gentoo.org>2012-03-18 23:01:51 -0400
commit0d5b2a081c7d48464d059494ed889e52c0d185d9 (patch)
tree057cfe733855e66598b746f7d5141febda81f263
parentFix xorg.conf.d parsing (diff)
downloadopenrc-settingsd-0d5b2a081c7d48464d059494ed889e52c0d185d9.tar.gz
openrc-settingsd-0d5b2a081c7d48464d059494ed889e52c0d185d9.tar.bz2
openrc-settingsd-0d5b2a081c7d48464d059494ed889e52c0d185d9.zip
Respect --debug switch when using >=glib-2.31.2
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index fabb96c..887cccd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -40,6 +40,7 @@ static GOptionEntry option_entries[] =
{ NULL }
};
+/* Emulates the new behavior of g_log_default_handler introduced in glib-2.31.2 */
static void
log_handler (const gchar *log_domain,
GLogLevelFlags log_level,
@@ -58,7 +59,6 @@ main (gint argc, gchar *argv[])
GMainLoop *loop = NULL;
g_type_init ();
- g_log_set_default_handler (log_handler, NULL);
option_context = g_option_context_new ("- system settings D-Bus service for OpenRC");
g_option_context_add_main_entries (option_context, option_entries, NULL);
@@ -67,6 +67,12 @@ main (gint argc, gchar *argv[])
exit (1);
}
+ if (glib_check_version (2, 31, 2) == NULL) {
+ if (debug)
+ g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
+ } else
+ g_log_set_default_handler (log_handler, NULL);
+
shell_utils_init ();
hostnamed_init (read_only);
localed_init (read_only);