summaryrefslogtreecommitdiff
path: root/src/greeter.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2014-09-15 16:48:28 +1200
committerRobert Ancell <robert.ancell@canonical.com>2014-09-15 16:48:28 +1200
commita1598ecec5b60a9d6f99dbde8e213070f143896e (patch)
tree68ffca6aae45e11770230714ae8940246ce127ba /src/greeter.c
parenta211c6654a533a8b5334052153591ef28faa9ed4 (diff)
downloadlightdm-git-a1598ecec5b60a9d6f99dbde8e213070f143896e.tar.gz
Print error messages if fail to set channel encodings
Diffstat (limited to 'src/greeter.c')
-rw-r--r--src/greeter.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/greeter.c b/src/greeter.c
index bfc77094..ba69febe 100644
--- a/src/greeter.c
+++ b/src/greeter.c
@@ -956,6 +956,7 @@ greeter_start (Session *session)
int to_greeter_pipe[2], from_greeter_pipe[2];
gboolean result = FALSE;
gchar *value;
+ GError *error = NULL;
/* Create a pipe to talk with the greeter */
if (pipe (to_greeter_pipe) != 0 || pipe (from_greeter_pipe) != 0)
@@ -964,9 +965,15 @@ greeter_start (Session *session)
return FALSE;
}
greeter->priv->to_greeter_channel = g_io_channel_unix_new (to_greeter_pipe[1]);
- g_io_channel_set_encoding (greeter->priv->to_greeter_channel, NULL, NULL);
+ g_io_channel_set_encoding (greeter->priv->to_greeter_channel, NULL, &error);
+ if (error)
+ g_warning ("Failed to set encoding on to greeter channel to binary: %s\n", error->message);
+ g_clear_error (&error);
greeter->priv->from_greeter_channel = g_io_channel_unix_new (from_greeter_pipe[0]);
- g_io_channel_set_encoding (greeter->priv->from_greeter_channel, NULL, NULL);
+ g_io_channel_set_encoding (greeter->priv->from_greeter_channel, NULL, &error);
+ if (error)
+ g_warning ("Failed to set encoding on from greeter channel to binary: %s\n", error->message);
+ g_clear_error (&error);
g_io_channel_set_buffered (greeter->priv->from_greeter_channel, FALSE);
greeter->priv->from_greeter_watch = g_io_add_watch (greeter->priv->from_greeter_channel, G_IO_IN | G_IO_HUP, read_cb, greeter);