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.
This commit is contained in:
Dan Williams
2009-10-20 12:10:30 -07:00
parent 3d194df94a
commit c9d2d977dd
2 changed files with 10 additions and 5 deletions

View File

@@ -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 /* 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. * 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", g_warning ("%s: Error getting '%s' for %s: (%d) %s\n",
__func__, __func__,
prop_name, prop_name,

View File

@@ -90,10 +90,15 @@ get_all_cb (DBusGProxy *proxy,
if (!dbus_g_proxy_end_call (proxy, call, &error, if (!dbus_g_proxy_end_call (proxy, call, &error,
DBUS_TYPE_G_MAP_OF_VARIANT, &props, DBUS_TYPE_G_MAP_OF_VARIANT, &props,
G_TYPE_INVALID)) { G_TYPE_INVALID)) {
/* 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.", g_warning ("%s: couldn't retrieve system settings properties: (%d) %s.",
__func__, __func__,
error ? error->code : -1, error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)"); (error && error->message) ? error->message : "(unknown)");
}
g_clear_error (&error); g_clear_error (&error);
return; return;
} }