OSDN Git Service

Log return error code for failure case.
authorJaikumar Ganesh <jaikumar@google.com>
Sat, 25 Jun 2011 01:20:40 +0000 (18:20 -0700)
committerJaikumar Ganesh <jaikumar@google.com>
Wed, 29 Jun 2011 01:19:05 +0000 (18:19 -0700)
This will help debug BT turn on problems.

Change-Id: Idda3dcdc6727e4b017f4a7a2805facc217340144

bluedroid/bluetooth.c

index 488877f..bf188be 100644 (file)
@@ -167,14 +167,16 @@ int bt_enable() {
         hci_sock = create_hci_sock();
         if (hci_sock < 0) goto out;
 
-        if (!ioctl(hci_sock, HCIDEVUP, HCI_DEV_ID)) {
+        ret = ioctl(hci_sock, HCIDEVUP, HCI_DEV_ID);
+        if (!ret) {
             break;
         }
         close(hci_sock);
         usleep(10000);  // 10 ms retry delay
     }
     if (attempt == 0) {
-        LOGE("%s: Timeout waiting for HCI device to come up", __FUNCTION__);
+        LOGE("%s: Timeout waiting for HCI device to come up, error- %d, ",
+            __FUNCTION__, ret);
         set_bluetooth_power(0);
         goto out;
     }