bluetooth: ignore "No such adapter" warnings when bluetooth is inactive

This commit is contained in:
Dan Williams
2011-12-12 14:06:22 -06:00
parent a868fd5a98
commit f03b0ac176

View File

@@ -181,8 +181,11 @@ default_adapter_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
if (!dbus_g_proxy_end_call (proxy, call, &err, if (!dbus_g_proxy_end_call (proxy, call, &err,
DBUS_TYPE_G_OBJECT_PATH, &default_adapter, DBUS_TYPE_G_OBJECT_PATH, &default_adapter,
G_TYPE_INVALID)) { G_TYPE_INVALID)) {
/* Ignore "No such adapter" errors; just means bluetooth isn't active */
if (!dbus_g_error_has_name (err, "org.bluez.Error.NoSuchAdapter")) {
nm_log_warn (LOGD_BT, "bluez error getting default adapter: %s", nm_log_warn (LOGD_BT, "bluez error getting default adapter: %s",
err && err->message ? err->message : "(unknown)"); err && err->message ? err->message : "(unknown)");
}
g_error_free (err); g_error_free (err);
return; return;
} }