aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc/rc.d/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rc/rc.d/bluetooth')
-rwxr-xr-xlibexec/rc/rc.d/bluetooth13
1 files changed, 11 insertions, 2 deletions
diff --git a/libexec/rc/rc.d/bluetooth b/libexec/rc/rc.d/bluetooth
index 22bd5078034d..193fd969967f 100755
--- a/libexec/rc/rc.d/bluetooth
+++ b/libexec/rc/rc.d/bluetooth
@@ -127,8 +127,17 @@ bluetooth_setup_stack()
> /dev/null 2>&1 || return 1
# Initilalize HCI node
- ${hccontrol} -n ${dev}hci reset \
- > /dev/null 2>&1 || return 1
+ for loop in 1 2 3
+ do
+ ${hccontrol} -n ${dev}hci reset \
+ > /dev/null 2>&1 && break
+ if [ ${loop} -eq 3 ]
+ then
+ warn Reset failed three times, giving up.
+ return 1
+ fi
+ warn Reset failed, retrying.
+ done
${hccontrol} -n ${dev}hci read_bd_addr \
> /dev/null 2>&1 || return 1