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

Commit e380f265 authored by Yun-hao Chung's avatar Yun-hao Chung Committed by Gerrit Code Review
Browse files

Merge "Floss: Handle EOF case in socket read" into main

parents 3e83bcae 5ddab291
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -145,6 +145,9 @@ int waitHciDev(int hci_interface) {
      if (n < 0) {
        bluetooth::log::error("Error reading control channel: {}", strerror(errno));
        break;
      } else if (n == 0) { // unlikely to happen, just a safeguard.
        bluetooth::log::error("Error reading control channel: EOF");
        break;
      }

      if (ev.opcode == MGMT_EV_COMMAND_COMP) {
+4 −0
Original line number Diff line number Diff line
@@ -141,6 +141,10 @@ uint16_t Mgmt::get_vs_opcode(uint16_t vendor_specification) {
          log::error("Failed to read mgmt socket: {}", -errno);
          close(fd);
          return ret_opcode;
        } else if (ret == 0) { // unlikely to happen, just a safeguard.
          log::error("Failed to read mgmt socket: EOF");
          close(fd);
          return ret_opcode;
        }

        if (cc_ev.opcode == MGMT_EV_COMMAND_COMPLETE) {
+3 −0
Original line number Diff line number Diff line
@@ -200,6 +200,9 @@ int mgmt_get_codec_capabilities(int fd, uint16_t hci) {
        if (ret < 0) {
          log::debug("Failed to read mgmt socket: {}", -errno);
          return -errno;
        } else if (ret == 0) { // unlikely to happen, just a safeguard.
          log::debug("Failed to read mgmt socket: EOF");
          return -1;
        }

        if (ev.opcode == MGMT_EV_COMMAND_COMPLETE) {