summaryrefslogtreecommitdiffstats
path: root/src/adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-12-01 01:56:51 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-12-01 01:56:51 +0200
commitf345d81fe368294091c4f87be1f80e2226ef4ce1 (patch)
tree46e6f552fcd491dc5b1f482251c43c04f92d8dfb /src/adapter.c
parent152a3cbd8f2ff8fbf7b0739adf0624ce430a9ee3 (diff)
Stop the security manager if we do a DEVDOWN in adapter_up
Diffstat (limited to 'src/adapter.c')
-rw-r--r--src/adapter.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 854e419f..0f427ef4 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2512,7 +2512,7 @@ static int get_pairable_timeout(const char *src)
return main_opts.pairto;
}
-static void adapter_up(struct btd_adapter *adapter, int dd)
+static int adapter_up(struct btd_adapter *adapter, int dd)
{
char mode[14], srcaddr[18];
int i;
@@ -2555,9 +2555,7 @@ static void adapter_up(struct btd_adapter *adapter, int dd)
else
write_device_mode(&adapter->bdaddr, mode);
- adapter_up(adapter, dd);
-
- return;
+ return adapter_up(adapter, dd);
}
} else if (!g_str_equal(mode, "connectable") &&
adapter->discov_timeout == 0) {
@@ -2604,8 +2602,12 @@ proceed:
adapter->initialized = TRUE;
}
- if (dev_down)
+ if (dev_down) {
ioctl(dd, HCIDEVDOWN, adapter->dev_id);
+ return 1;
+ }
+
+ return 0;
}
int adapter_start(struct btd_adapter *adapter)
@@ -2712,13 +2714,13 @@ setup:
adapter->state &= ~STD_INQUIRY;
adapter_setup(adapter, dd);
- adapter_up(adapter, dd);
+ err = adapter_up(adapter, dd);
hci_close_dev(dd);
info("Adapter %s has been enabled", adapter->path);
- return 0;
+ return err;
}
static void reply_pending_requests(struct btd_adapter *adapter)