From 83e02840b5ce1cf8c122cc70918ddd57396c91db Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 23 Nov 2010 22:17:21 -0600 Subject: [PATCH 3/4] core: suppress error message when user settings service is not active Don't bother trying to initialize the user settings proxy when it isn't even active. Would trigger a warning to syslog if PolicyKit permissions changed via changes to /usr/share/polkit-1/actions/. --- src/nm-manager.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 48f2173..afcc6ad 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1356,6 +1356,12 @@ user_proxy_init (NMManager *self) g_return_if_fail (self != NULL); g_return_if_fail (priv->user_proxy == NULL); + /* Don't try to initialize the user settings proxy if the user + * settings service doesn't actually exist. + */ + if (!nm_dbus_manager_name_has_owner (priv->dbus_mgr, NM_DBUS_SERVICE_USER_SETTINGS)) + return; + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); priv->user_proxy = dbus_g_proxy_new_for_name_owner (bus, NM_DBUS_SERVICE_USER_SETTINGS, @@ -3975,8 +3981,7 @@ nm_manager_start (NMManager *self) * they will be queried when the user settings service shows up on the * bus in nm_manager_name_owner_changed(). */ - if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, NM_DBUS_SERVICE_USER_SETTINGS)) - user_proxy_init (self); + user_proxy_init (self); nm_udev_manager_query_devices (priv->udev_mgr); bluez_manager_resync_devices (self); -- 1.7.3.4