gnome-session/0001-binary-Log-a-critical-when-our-SIGTERM-SIGINT-handle.patch

37 lines
1.1 KiB
Diff
Raw Normal View History

From 16f3e738f1e831c3af0f2b0718260601298af0ed Mon Sep 17 00:00:00 2001
From: Iain Lane <iainl@gnome.org>
Date: Tue, 10 Dec 2019 12:37:31 +0000
Subject: [PATCH 1/2] binary: Log a critical when our SIGTERM/SIGINT handler
fails to log out
---
gnome-session/main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gnome-session/main.c b/gnome-session/main.c
index c9488823..152e60ed 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -103,12 +103,17 @@ 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);
+ }
return FALSE;
}
--
2.23.0