Hi there! The bluez-libs functions hci_for_each_dev(), hci_devinfo() and hci_inquiry() don't save the 'errno' value when an error occurs. This causes the value of 'errno' to be overwrinting on some kind of errors. The attached patch fixes it. Note that was necessary to change hci_inquiry() a bit, and I've added the missing error code to 'errno' when a device is not found by hci_for_each_dev(), it fixes things like that: ~/ hcitool scan Device is not available: Success ~/ src/hci.c | 70 ++++++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 41 insertions(+), 29 deletions(-) Thank you, -- Luiz Fernando N. Capitulino