[gnome-session/benzea/more-error-logging: 1/2] main: Use already defined error from main function.




commit 24939f5b487668a14e8c67de7780097978b49905
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Oct 19 12:06:55 2020 +0200

    main: Use already defined error from main function.

 gnome-session/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnome-session/main.c b/gnome-session/main.c
index 84edfbe5a..53f174e5f 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -539,7 +539,6 @@ main (int argc, char **argv)
 
 #ifdef ENABLE_SYSTEMD_SESSION
         if (use_systemd && !systemd_service) {
-                g_autoptr(GError) error = NULL;
                 g_autofree gchar *gnome_session_target;
                 const gchar *session_type;
 
@@ -571,6 +570,7 @@ main (int argc, char **argv)
 
                 /* We could not start the unit, fall back. */
                  g_warning ("Falling back to non-systemd startup procedure due to error: %s", 
error->message);
+                 g_clear_error (&error);
         }
 #endif /* ENABLE_SYSTEMD_SESSION */
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]