mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
- 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)
This commit is contained in:
parent
4bb0f51d1d
commit
02afd3d137
1 changed files with 6 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue