Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53e44434 authored by Rob Herring's avatar Rob Herring Committed by Ajay Panicker
Browse files

btlinux: wait forever for a BT device



Not really hotplug support, but this prevents bluetooth from crashing
repeatedly when no device is present.

Change-Id: I6f97fde05780f50a8fcd3ce39a64336f238fa4be
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent aa8be54f
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -39,7 +39,6 @@
#define MGMT_EV_INDEX_ADDED 0x0004
#define MGMT_EV_INDEX_ADDED 0x0004
#define MGMT_EV_COMMAND_COMP 0x0001
#define MGMT_EV_COMMAND_COMP 0x0001
#define MGMT_EV_SIZE_MAX 1024
#define MGMT_EV_SIZE_MAX 1024
#define MGMT_EV_POLL_TIMEOUT 3000 /* 3000ms */
#define WRITE_NO_INTR(fn) \
#define WRITE_NO_INTR(fn) \
  do {                  \
  do {                  \
  } while ((fn) == -1 && errno == EINTR)
  } while ((fn) == -1 && errno == EINTR)
@@ -154,7 +153,7 @@ int BluetoothHci::waitHciDev(int hci_interface) {
  /* validate mentioned hci interface is present and registered with sock system */
  /* validate mentioned hci interface is present and registered with sock system */
  while (1) {
  while (1) {
    int n;
    int n;
    WRITE_NO_INTR(n = poll(fds, 1, MGMT_EV_POLL_TIMEOUT));
    WRITE_NO_INTR(n = poll(fds, 1, -1));
    if (n == -1) {
    if (n == -1) {
      ALOGE( "Poll error: %s", strerror(errno));
      ALOGE( "Poll error: %s", strerror(errno));
      ret = -1;
      ret = -1;