Skip to content

Commit

Permalink
WSC: set the GIO encoding for the from USC pipe to binary
Browse files Browse the repository at this point in the history
We always read raw data from the pipe, thus this should have been set
since this file was written. However, for some reason this has nerver
been set, and for some unknown reason this has never been a problem on
Xenial port of UT. However, not having this caused an infinite hang on
g_io_channel_read_chars(), presumebly because it's trying to interpret
a binary data as an incomplete UTF-8 character.

From:
https://gitlab.com/ubports/core/packaging/lightdm/-/commit/6616c8a8b6451751d130696f8edcf8aff0c11c35
Author: Ratchanan Srirattanamet
  • Loading branch information
mariogrip committed Feb 15, 2023
1 parent 1c1dff2 commit 0c4a3b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wayland-system-compositor.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,12 @@ wayland_system_compositor_start (DisplayServer *server)
fcntl (priv->from_compositor_pipe[0], F_SETFD, FD_CLOEXEC);

/* Listen for messages from the compositor */
g_autoptr(GError) from_error = NULL;
priv->from_compositor_channel = g_io_channel_unix_new (priv->from_compositor_pipe[0]);
g_io_channel_set_encoding(priv->from_compositor_channel, /* encoding */ NULL, &from_error);
if (from_error)
g_warning ("Failed to set encoding on from compositor channel to binary: %s\n", from_error->message);

priv->from_compositor_watch = g_io_add_watch (priv->from_compositor_channel, G_IO_IN | G_IO_HUP, read_cb, compositor);

/* Setup logging */
Expand Down

0 comments on commit 0c4a3b0

Please sign in to comment.