summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-08-16 13:09:49 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-08-16 13:09:49 -0400
commit6203cc968c00c4c8fc5e5fe45b5105c5571d3dcc (patch)
treee3909ace64b5584bcc627a95aa3a9de9a4b67cbd
parent26df8c6639f844bb1db70cc409a1de8a43cb807d (diff)
downloadgnome-session-fix-criticals.tar.gz
Fix criticalsfix-criticals
I see this in my logs: gnome-session-binary[1224]: GLib-GIO-CRITICAL: g_bus_get_sync: assertion 'error == NULL || *error == NULL' failed gnome-session-binary[1224]: GLib-GIO-CRITICAL: g_bus_get_sync: assertion 'error == NULL || *error == NULL' failed After staring at gnome-session code for a while, I've concluded that this happens because we sometimes fail to clear the error variable that gets reused all over main(). So, clear it always.
-rw-r--r--gnome-session/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gnome-session/main.c b/gnome-session/main.c
index a460a849..d2a90761 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -543,8 +543,10 @@ main (int argc, char **argv)
#ifdef HAVE_SYSTEMD
gsm_util_export_user_environment (&error);
- if (error && !g_getenv ("RUNNING_UNDER_GDM")) {
- g_warning ("Failed to upload environment to systemd: %s", error->message);
+ if (error) {
+ if (!g_getenv ("RUNNING_UNDER_GDM")) {
+ g_warning ("Failed to upload environment to systemd: %s", error->message);
+ }
g_clear_error (&error);
}
#endif
@@ -567,8 +569,10 @@ main (int argc, char **argv)
* in a previous session
*/
gsm_util_systemd_reset_failed (&error);
- if (error && !g_getenv ("RUNNING_UNDER_GDM")) {
- g_warning ("Failed to reset failed state of units: %s", error->message);
+ if (error) {
+ if (!g_getenv ("RUNNING_UNDER_GDM")) {
+ g_warning ("Failed to reset failed state of units: %s", error->message);
+ }
g_clear_error (&error);
}