# Ported from gnome-session git commit 16f3e738f1e831c3af0f2b0718260601298af0ed # (16.12.2019) - "binary: Log a critical when our SIGTERM/SIGINT handler fails to log out" # (https://github.com/GNOME/gnome-session/commit/16f3e73): # ============================================================================= # diff -up mate-session-manager-f56f8cd63d330e576aeabd09a0600a8da2e02392/mate-session/main.c~ mate-session-manager-f56f8cd63d330e576aeabd09a0600a8da2e02392/mate-session/main.c --- mate-session-manager-f56f8cd63d330e576aeabd09a0600a8da2e02392/mate-session/main.c~ 2021-05-17 02:32:18.426374318 +0200 +++ mate-session-manager-f56f8cd63d330e576aeabd09a0600a8da2e02392/mate-session/main.c 2021-05-17 02:32:18.441374416 +0200 @@ -436,6 +436,8 @@ static gboolean signal_cb(int signo, gpo int ret; GsmManager* manager; + g_autoptr(GError) error = NULL; + g_debug("Got callback for signal %d", signo); ret = TRUE; @@ -451,7 +453,11 @@ static gboolean signal_cb(int signo, gpo case SIGINT: case SIGTERM: manager = (GsmManager*) data; - 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); + } /* let the fatal signals interrupt us */ g_debug("Caught signal %d, shutting down normally.", signo);