summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-08-12 16:18:16 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-08-13 14:05:14 +0300
commitd72f1713ae2edef21d7a9c3d74bb87d26e25cb95 (patch)
tree64752d70e88c014afc0aacf3035a7967bcec9992 /tools
parent302e4163f39e87fe6ab951bc2e2eb322b43ed6cd (diff)
downloadbluez-d72f1713ae2edef21d7a9c3d74bb87d26e25cb95.tar.gz
tools/hciconfig: Add missing hci_close_dev
Add hci_close_dev for commands using hci_open_dev, this is mostly to be consistent with other commands that do cleanup but in practice makes no difference since hciconfig will exit anyway.
Diffstat (limited to 'tools')
-rw-r--r--tools/hciconfig.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 0e0b7909a..eac96b072 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -963,6 +963,8 @@ static void cmd_class(int ctl, int hdev, char *opt)
printf("%s, %s\n", major_devices[cls[1] & 0x1f],
get_minor_device_name(cls[1] & 0x1f, cls[0] >> 2));
}
+
+ hci_close_dev(hdev);
}
static void cmd_voice(int ctl, int hdev, char *opt)
@@ -1023,6 +1025,8 @@ static void cmd_voice(int ctl, int hdev, char *opt)
}
printf("\tAir Coding Format: %s\n", acf[vs & 0x03]);
}
+
+ hci_close_dev(s);
}
static void cmd_delkey(int ctl, int hdev, char *opt)
@@ -1462,6 +1466,8 @@ static void cmd_inq_parms(int ctl, int hdev, char *opt)
printf("\tInquiry interval: %u slots (%.2f ms), window: %u slots (%.2f ms)\n",
interval, (float)interval * 0.625, window, (float)window * 0.625);
}
+
+ hci_close_dev(s);
}
static void cmd_page_parms(int ctl, int hdev, char *opt)
@@ -1533,6 +1539,8 @@ static void cmd_page_parms(int ctl, int hdev, char *opt)
interval, (float)interval * 0.625,
window, (float)window * 0.625);
}
+
+ hci_close_dev(s);
}
static void cmd_page_to(int ctl, int hdev, char *opt)
@@ -1597,6 +1605,8 @@ static void cmd_page_to(int ctl, int hdev, char *opt)
printf("\tPage timeout: %u slots (%.2f ms)\n",
timeout, (float)timeout * 0.625);
}
+
+ hci_close_dev(s);
}
static void cmd_afh_mode(int ctl, int hdev, char *opt)
@@ -1630,6 +1640,8 @@ static void cmd_afh_mode(int ctl, int hdev, char *opt)
print_dev_hdr(&di);
printf("\tAFH mode: %s\n", mode == 1 ? "Enabled" : "Disabled");
}
+
+ hci_close_dev(dd);
}
static void cmd_ssp_mode(int ctl, int hdev, char *opt)
@@ -1664,6 +1676,8 @@ static void cmd_ssp_mode(int ctl, int hdev, char *opt)
printf("\tSimple Pairing mode: %s\n",
mode == 1 ? "Enabled" : "Disabled");
}
+
+ hci_close_dev(dd);
}
static void print_rev_ericsson(int dd)
@@ -1790,6 +1804,9 @@ static void cmd_revision(int ctl, int hdev, char *opt)
printf("\tUnsupported manufacturer\n");
break;
}
+
+ hci_close_dev(dd);
+
return;
}