From 5a9a5e997a25ad493084921837e8684a8ecc98ab Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 15 Dec 2017 11:29:18 +0000 Subject: [PATCH] Error reporting fixes --- libs/core/serialnumber.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/core/serialnumber.cpp b/libs/core/serialnumber.cpp index 7efde89f..b22daafd 100644 --- a/libs/core/serialnumber.cpp +++ b/libs/core/serialnumber.cpp @@ -27,11 +27,11 @@ struct hci_dev_list_req { static uint32_t bt_addr() { - uint32_t res = 0; + uint32_t res = -1; int fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (fd < 0) { - DMESG("Can't open HCI socket"); + DMESG("BT_ADDR: can't open HCI socket"); return res; } @@ -39,7 +39,7 @@ static uint32_t bt_addr() { dl.dev_num = 1; if (ioctl(fd, HCIGETDEVLIST, (void *)&dl) < 0) { - DMESG("Failed to get HCI device list"); + DMESG("BT_ADDR: can't get HCI device list"); goto done; } @@ -47,7 +47,7 @@ static uint32_t bt_addr() { di.dev_id = dl.dev_req[0].dev_id; if (ioctl(fd, HCIGETDEVINFO, (void *)&di) < 0) { - DMESG("Failed to get HCI device list"); + DMESG("BT_ADDR: can't get HCI device info"); goto done; }