diff options
author | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-03-18 23:01:51 -0400 |
---|---|---|
committer | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-03-18 23:01:51 -0400 |
commit | 0d5b2a081c7d48464d059494ed889e52c0d185d9 (patch) | |
tree | 057cfe733855e66598b746f7d5141febda81f263 /src | |
parent | Fix xorg.conf.d parsing (diff) | |
download | openrc-settingsd-0d5b2a081c7d48464d059494ed889e52c0d185d9.tar.gz openrc-settingsd-0d5b2a081c7d48464d059494ed889e52c0d185d9.tar.bz2 openrc-settingsd-0d5b2a081c7d48464d059494ed889e52c0d185d9.zip |
Respect --debug switch when using >=glib-2.31.2
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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); |