diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-08-16 13:09:49 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-08-16 13:09:49 -0400 |
commit | 6203cc968c00c4c8fc5e5fe45b5105c5571d3dcc (patch) | |
tree | e3909ace64b5584bcc627a95aa3a9de9a4b67cbd | |
parent | 26df8c6639f844bb1db70cc409a1de8a43cb807d (diff) | |
download | gnome-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.c | 12 |
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); } |