summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bluetooth/hccontrol/hccontrol.c
diff options
context:
space:
mode:
authormarkus <markus@FreeBSD.org>2006-06-02 00:29:01 +0000
committermarkus <markus@FreeBSD.org>2006-06-02 00:29:01 +0000
commit9e4a31c8ecc6ec30abcdd3ec6f6d03ff71afcf14 (patch)
treee8dc57861a955a955ceb40b88f3ce9018f3cd411 /usr.sbin/bluetooth/hccontrol/hccontrol.c
parent9a61d7bd7216d9c38e1b6208133d87d1b18f834b (diff)
downloadFreeBSD-src-9e4a31c8ecc6ec30abcdd3ec6f6d03ff71afcf14.zip
FreeBSD-src-9e4a31c8ecc6ec30abcdd3ec6f6d03ff71afcf14.tar.gz
- Only print a clarifying message about which HCI node has been used if there
is more than one HCI node present - Use errx(3) instead of err(3) if there is no HCI node present as errno is 0 in this case and the resulting error message wouldn't make much sense Approved by: emax (mentor)
Diffstat (limited to 'usr.sbin/bluetooth/hccontrol/hccontrol.c')
-rw-r--r--usr.sbin/bluetooth/hccontrol/hccontrol.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/bluetooth/hccontrol/hccontrol.c b/usr.sbin/bluetooth/hccontrol/hccontrol.c
index c77200e..089869b 100644
--- a/usr.sbin/bluetooth/hccontrol/hccontrol.c
+++ b/usr.sbin/bluetooth/hccontrol/hccontrol.c
@@ -99,16 +99,18 @@ socket_open(char const *node)
{
struct sockaddr_hci addr;
struct ng_btsocket_hci_raw_filter filter;
- int s, mib[4];
+ int s, mib[4], num;
size_t size;
struct nodeinfo *nodes;
- if (find_hci_nodes(&nodes) == 0)
- err(7, "Could not find HCI nodes");
+ num = find_hci_nodes(&nodes);
+ if (num == 0)
+ errx(7, "Could not find HCI nodes");
if (node == NULL) {
node = strdup(nodes[0].name);
- fprintf(stdout, "Using HCI node: %s\n", node);
+ if (num > 1)
+ fprintf(stdout, "Using HCI node: %s\n", node);
}
free(nodes);
OpenPOWER on IntegriCloud