OSDN Git Service

Add a missing OSI_NO_INTR() wrapper around socket read()
authorPavlin Radoslavov <pavlin@google.com>
Wed, 18 May 2016 22:22:55 +0000 (15:22 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Thu, 19 May 2016 22:57:51 +0000 (22:57 +0000)
Also, print a better error message.

Change-Id: I22da05fd5e9b10a5122705105ea7a45855eb144d
(cherry picked from commit a5c0f1596095ec9017bb50c035f327f708a5d8e8)

vendor_libs/linux/bt_vendor_linux.c

index eec3e01..41abc8a 100644 (file)
@@ -202,10 +202,10 @@ static int bt_vendor_wait_hcidev(void)
     }
 
     if (fds[0].revents & POLLIN) {
-      n = read(fd, &ev, sizeof(struct mgmt_pkt));
+      OSI_NO_INTR(n = read(fd, &ev, sizeof(struct mgmt_pkt)));
       if (n < 0) {
-        LOG_ERROR(LOG_TAG,
-                  "Error reading control channel");
+        LOG_ERROR(LOG_TAG, "Error reading control channel: %s",
+                  strerror(errno));
         ret = -1;
         break;
       }