[glib] gdbusnameowning: Don't spew an error if we're releasing a name due to closing



commit 31aee73285729b1d0d2210cb728b4b2d52711678
Author: Colin Walters <walters verbum org>
Date:   Fri Jul 19 11:50:35 2013 -0400

    gdbusnameowning: Don't spew an error if we're releasing a name due to closing
    
    The default GNOME 3.10 login process right now has gdm spawn a session
    for the login screen, retaining the X server, but closing the session
    bus.  Right now in this scenario many GNOME components such as
    gnome-settings-daemon attempt to "clean up" on shutdown by releasing
    their owned names.
    
    But they're shutting down because the session bus went away, so
    releasing the name is pointless, and presently spews an error into the
    journal.
    
    This patch avoids that error spew, which helps system administrators
    find *real* problems.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704567

 gio/gdbusnameowning.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdbusnameowning.c b/gio/gdbusnameowning.c
index 260b088..791d2f5 100644
--- a/gio/gdbusnameowning.c
+++ b/gio/gdbusnameowning.c
@@ -899,7 +899,9 @@ g_bus_unown_name (guint owner_id)
   if (client != NULL)
     {
       /* Release the name if needed */
-      if (client->needs_release && client->connection != NULL)
+      if (client->needs_release &&
+          client->connection != NULL &&
+          !g_dbus_connection_is_closed (client->connection))
         {
           GVariant *result;
           GError *error;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]