summaryrefslogtreecommitdiffstats
path: root/hcid/security.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/security.c')
-rw-r--r--hcid/security.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/hcid/security.c b/hcid/security.c
index a980b500..75e44421 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -352,24 +352,6 @@ gboolean io_security_event(GIOChannel *chan, GIOCondition cond, gpointer data)
return TRUE;
}
-static void init_security_data(void)
-{
- static int initialized = 0;
-
- if (initialized)
- return;
- initialized = 1;
-
- /* Set local PIN code */
- if (hcid.security == HCID_SEC_AUTO) {
- if (read_pin_code() < 0) {
- strcpy(hcid.pin_code, "bluez");
- hcid.pin_len = 5;
- }
- }
- return;
-}
-
void start_security_manager(int hdev)
{
GIOChannel *chan = io_chan[hdev];
@@ -382,8 +364,6 @@ void start_security_manager(int hdev)
syslog(LOG_INFO, "Starting security manager %d", hdev);
- init_security_data();
-
if ((dev = hci_open_dev(hdev)) < 0) {
syslog(LOG_ERR, "Can't open device hci%d. %s(%d)",
hdev, strerror(errno), errno);
@@ -438,3 +418,13 @@ void stop_security_manager(int hdev)
close(g_io_channel_unix_get_fd(chan));
io_chan[hdev] = NULL;
}
+
+void init_security_data(void)
+{
+ /* Set local PIN code */
+ if (read_pin_code() < 0) {
+ strcpy(hcid.pin_code, "BlueZ");
+ hcid.pin_len = 5;
+ }
+ return;
+}