[mutter/gnome-3-28] xwayland: use g_autoptr for GError in xserver_died
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-28] xwayland: use g_autoptr for GError in xserver_died
- Date: Tue, 24 Apr 2018 05:08:14 +0000 (UTC)
commit 99d766c044ab5286af0d40c5350a1fb28f9bcb0b
Author: Ray Strode <rstrode redhat com>
Date: Thu Apr 12 14:03:03 2018 -0400
xwayland: use g_autoptr for GError in xserver_died
Right now we explicitly g_clear_error any error we find, but that
makes it tricky to return early from the function, which a
subsequent commit will want to to do.
This commit switches GError to use g_autoptr so the error clearing
happens automatically.
(cherry picked from commit bb6585406543688f3df48aea3211726ce52a8f29)
src/wayland/meta-xwayland.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 4a7c8fffd..774997611 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -393,13 +393,12 @@ xserver_died (GObject *source,
gpointer user_data)
{
GSubprocess *proc = G_SUBPROCESS (source);
- GError *error = NULL;
+ g_autoptr (GError) error = NULL;
if (!g_subprocess_wait_finish (proc, result, &error))
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_error ("Failed to finish waiting for Xwayland: %s", error->message);
- g_clear_error (&error);
}
else if (!g_subprocess_get_successful (proc))
g_error ("X Wayland crashed; aborting");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]