diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-07-09 17:18:50 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-07-09 17:56:20 +0200 |
commit | f44ac46485d79af1d4d382e559a5caab29e4ae3d (patch) | |
tree | 3ebf9a394ec59ed2a7ab98e0e04936bfc7710693 | |
parent | e101167e55a99756cda8f86a7677959654dcbb8c (diff) | |
download | NetworkManager-f44ac46485d79af1d4d382e559a5caab29e4ae3d.tar.gz |
bluetooth: avoid an assertion failure if built w/o bluez5 support
Fail with a proper error if we built without Bluez 5 support, but detect it at
runtime.
-rw-r--r-- | src/devices/bluetooth/nm-bluez-device.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c index 48f7ddf0ef..419339aca3 100644 --- a/src/devices/bluetooth/nm-bluez-device.c +++ b/src/devices/bluetooth/nm-bluez-device.c @@ -28,6 +28,7 @@ #include "nm-core-internal.h" +#include "nm-bt-error.h" #include "nm-bluez-common.h" #include "nm-bluez-device.h" #include "nm-logging.h" @@ -436,8 +437,6 @@ nm_bluez_device_disconnect (NMBluezDevice *self) } else if (priv->bluez_version == 5) { #if WITH_BLUEZ5_DUN nm_bluez5_dun_cleanup (priv->b5_dun_context); -#else - g_assert_not_reached (); #endif priv->connected = FALSE; goto out; @@ -559,7 +558,11 @@ nm_bluez_device_connect_async (NMBluezDevice *self, priv->b5_dun_context = nm_bluez5_dun_new (priv->adapter_address, priv->address); nm_bluez5_dun_connect (priv->b5_dun_context, bluez5_dun_connect_cb, simple); #else - g_assert_not_reached (); + g_simple_async_result_set_error (simple, + NM_BT_ERROR, + NM_BT_ERROR_DUN_CONNECT_FAILED, + "NetworkManager built without support for Bluez 5"); + g_simple_async_result_complete (simple); #endif return; } |