From c9d2d977dd1ec6b882a7975c8c6f160096e2e9ce Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Oct 2009 12:10:30 -0700 Subject: [PATCH] libnm-glib: tighter warning print checks Should be checking for dbus-glib errors of the right type, instead of any error code (dbus-glib or not) that happens to be 4. --- libnm-glib/nm-object.c | 2 +- libnm-glib/nm-remote-settings-system.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index b0d2236e8..94bda26e5 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -496,7 +496,7 @@ _nm_object_get_property (NMObject *object, /* Don't warn about D-Bus no reply/timeout errors; it's mostly noise and * happens for example when NM quits and the applet is still running. */ - if (err->code != DBUS_GERROR_NO_REPLY) { + if (!(err->domain == DBUS_GERROR && err->code == DBUS_GERROR_NO_REPLY)) { g_warning ("%s: Error getting '%s' for %s: (%d) %s\n", __func__, prop_name, diff --git a/libnm-glib/nm-remote-settings-system.c b/libnm-glib/nm-remote-settings-system.c index 02aaff4cd..4e30fda80 100644 --- a/libnm-glib/nm-remote-settings-system.c +++ b/libnm-glib/nm-remote-settings-system.c @@ -90,10 +90,15 @@ get_all_cb (DBusGProxy *proxy, if (!dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_MAP_OF_VARIANT, &props, G_TYPE_INVALID)) { - g_warning ("%s: couldn't retrieve system settings properties: (%d) %s.", - __func__, - error ? error->code : -1, - (error && error->message) ? error->message : "(unknown)"); + /* Don't warn when the call times out because the settings service can't + * be activated or whatever. + */ + if (!(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NO_REPLY)) { + g_warning ("%s: couldn't retrieve system settings properties: (%d) %s.", + __func__, + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); + } g_clear_error (&error); return; }