diff options
| author | Michael Biebl <biebl@debian.org> | 2012-06-29 20:12:44 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2012-06-29 20:12:44 +0200 |
| commit | 867254ea7c2b193fecf8cd36cc6e5dc53c290d92 (patch) | |
| tree | 7c698b403882736ab70c3efd524c3460f08c391c /src/nm-device-bt.c | |
| parent | de06e5715e780baade318f3490ac7a4c9ce84e32 (diff) | |
Imported Upstream version 0.9.5.95 upstream/0.9.5.95
Diffstat (limited to 'src/nm-device-bt.c')
| -rw-r--r-- | src/nm-device-bt.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index 726762b6..f61aeb57 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -668,14 +668,18 @@ nm_device_bt_modem_removed (NMDeviceBt *self, NMModem *modem) if (modem != priv->modem) return FALSE; + /* Fail the device if the modem was removed while active */ state = nm_device_get_state (NM_DEVICE (self)); - nm_modem_device_state_changed (priv->modem, - NM_DEVICE_STATE_DISCONNECTED, - state, - NM_DEVICE_STATE_REASON_USER_REQUESTED); + if ( state == NM_DEVICE_STATE_ACTIVATED + || nm_device_is_activating (NM_DEVICE (self))) { + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED); + } else { + g_object_unref (priv->modem); + priv->modem = NULL; + } - g_object_unref (priv->modem); - priv->modem = NULL; return TRUE; } |