Blame SOURCES/0001-main-only-log-check-accelerated-errors-when-debuggin.patch

2d0792
From 55cd354ef9d0902c4e9e188a6020986bca9d7228 Mon Sep 17 00:00:00 2001
2d0792
From: Ray Strode <rstrode@redhat.com>
2d0792
Date: Wed, 6 May 2020 13:45:50 -0400
2d0792
Subject: [PATCH] main: only log check-accelerated errors when debugging
2d0792
 enabled
2d0792
2d0792
The journal currently gets spammed with messages like:
2d0792
2d0792
gnome-session: gnome-session-check-accelerated: GL Helper exited with code 512
2d0792
gnome-session: libEGL warning: DRI2: failed to authenticate
2d0792
gnome-session: gnome-session-check-accelerated: GLES Helper exited with code 512
2d0792
2d0792
if a the machine lacks accelerated graphics.  But lacking accelerated
2d0792
graphics isn't actually an error (many servers do).
2d0792
2d0792
This commit changes the messages to only show when debugging is enabled.
2d0792
---
2d0792
 gnome-session/main.c | 8 +++++++-
2d0792
 1 file changed, 7 insertions(+), 1 deletion(-)
2d0792
2d0792
diff --git a/gnome-session/main.c b/gnome-session/main.c
2d0792
index 0cd2f88a..567f5714 100644
2d0792
--- a/gnome-session/main.c
2d0792
+++ b/gnome-session/main.c
2d0792
@@ -202,72 +202,78 @@ require_dbus_session (int      argc,
2d0792
         g_return_val_if_fail (!g_str_has_prefix (argv[0], "dbus-launch"),
2d0792
                               TRUE);
2d0792
 
2d0792
         /* +2 for our new arguments, +1 for NULL */
2d0792
         new_argv = g_malloc ((argc + 3) * sizeof (*argv));
2d0792
 
2d0792
         new_argv[0] = "dbus-launch";
2d0792
         new_argv[1] = "--exit-with-session";
2d0792
         for (i = 0; i < argc; i++) {
2d0792
                 new_argv[i + 2] = argv[i];
2d0792
         }
2d0792
         new_argv[i + 2] = NULL;
2d0792
         
2d0792
         if (!execvp ("dbus-launch", new_argv)) {
2d0792
                 g_set_error (error, 
2d0792
                              G_SPAWN_ERROR,
2d0792
                              G_SPAWN_ERROR_FAILED,
2d0792
                              "No session bus and could not exec dbus-launch: %s",
2d0792
                              g_strerror (errno));
2d0792
                 return FALSE;
2d0792
         }
2d0792
 
2d0792
         /* Should not be reached */
2d0792
         return TRUE;
2d0792
 }
2d0792
 
2d0792
 static gboolean
2d0792
 check_gl (GError **error)
2d0792
 {
2d0792
         int status;
2d0792
+        g_autofree char *error_output = NULL;
2d0792
+
2d0792
         char *argv[] = { LIBEXECDIR "/gnome-session-check-accelerated", NULL };
2d0792
 
2d0792
         if (getenv ("DISPLAY") == NULL) {
2d0792
                 /* Not connected to X11, someone else will take care of checking GL */
2d0792
                 return TRUE;
2d0792
         }
2d0792
 
2d0792
-        if (!g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL, &gl_renderer, NULL,
2d0792
+        if (!g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL, &gl_renderer, &error_output,
2d0792
                            &status, error)) {
2d0792
                 return FALSE;
2d0792
         }
2d0792
 
2d0792
+        if (error_output != NULL) {
2d0792
+            g_debug ("%s", error_output);
2d0792
+        }
2d0792
+
2d0792
         return g_spawn_check_exit_status (status, error);
2d0792
 }
2d0792
 
2d0792
 static void
2d0792
 initialize_gio (void)
2d0792
 {
2d0792
         char *disable_fuse = NULL;
2d0792
         char *use_vfs = NULL;
2d0792
 
2d0792
         disable_fuse = g_strdup (g_getenv ("GVFS_DISABLE_FUSE"));
2d0792
         use_vfs = g_strdup (g_getenv ("GIO_USE_VFS"));
2d0792
 
2d0792
         g_setenv ("GVFS_DISABLE_FUSE", "1", TRUE);
2d0792
         g_setenv ("GIO_USE_VFS", "local", TRUE);
2d0792
         g_vfs_get_default ();
2d0792
 
2d0792
         if (use_vfs) {
2d0792
                 g_setenv ("GIO_USE_VFS", use_vfs, TRUE);
2d0792
                 g_free (use_vfs);
2d0792
         } else {
2d0792
                 g_unsetenv ("GIO_USE_VFS");
2d0792
         }
2d0792
 
2d0792
         if (disable_fuse) {
2d0792
                 g_setenv ("GVFS_DISABLE_FUSE", disable_fuse, TRUE);
2d0792
                 g_free (disable_fuse);
2d0792
         } else {
2d0792
                 g_unsetenv ("GVFS_DISABLE_FUSE");
2d0792
         }
2d0792
 }
2d0792
-- 
2d0792
2.25.1
2d0792