From: Ray Strode Date: Thu, 12 Apr 2018 18:03:03 +0000 (-0500) Subject: xwayland: use g_autoptr for GError in xserver_died X-Git-Tag: archive/raspbian/3.28.1-2+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=52efab3e46581beb367bd4c925fac0dc2cf550ab;p=mutter.git 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. Origin: https://gitlab.gnome.org/GNOME/mutter/commit/bb65854 Gbp-Pq: Name xwayland-use-g_autoptr-for-GError-in-xserver_died.patch --- diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 4a7c8ff..7749976 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");