[gnome-session/wip/laney/allow-early-exit-on-sigterm: 1/2] binary: Log a critical when our SIGTERM/SIGINT handler fails to log out



commit 7d872e62f62623d356ede69fa5e79c08f0a50171
Author: Iain Lane <iainl gnome org>
Date:   Tue Dec 10 12:37:31 2019 +0000

    binary: Log a critical when our SIGTERM/SIGINT handler fails to log out

 gnome-session/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gnome-session/main.c b/gnome-session/main.c
index c9488823..c4292f2c 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -103,12 +103,18 @@ on_name_lost (GDBusConnection *connection,
 static gboolean
 term_or_int_signal_cb (gpointer data)
 {
+        g_autoptr(GError) error = NULL;
         GsmManager *manager = (GsmManager *)data;
 
         /* let the fatal signals interrupt us */
         g_debug ("Caught SIGINT/SIGTERM, shutting down normally.");
 
-        gsm_manager_logout (manager, GSM_MANAGER_LOGOUT_MODE_FORCE, NULL);
+        gsm_manager_logout (manager, GSM_MANAGER_LOGOUT_MODE_FORCE, &error);
+
+        if (error != NULL) {
+                g_critical ("Failed to log out: %s", error->message);
+                gsm_quit ();
+        }
 
         return FALSE;
 }


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