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

Commit 0a8f6153 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "debuggerd_client: improve error logging."

parents e36f911a be0c1af6
Loading
Loading
Loading
Loading
+16 −8
Original line number Original line Diff line number Diff line
@@ -143,11 +143,15 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int
  ssize_t rc =
  ssize_t rc =
      TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC));
      TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC));
  if (rc == 0) {
  if (rc == 0) {
    LOG(ERROR) << "libdebuggerd_client: failed to read response from tombstoned: timeout reached?";
    LOG(ERROR) << "libdebuggerd_client: failed to read initial response from tombstoned: "
               << "timeout reached?";
    return false;
  } else if (rc == -1) {
    PLOG(ERROR) << "libdebuggerd_client: failed to read initial response from tombstoned";
    return false;
    return false;
  } else if (rc != sizeof(response)) {
  } else if (rc != sizeof(response)) {
    LOG(ERROR)
    LOG(ERROR) << "libdebuggerd_client: received packet of unexpected length from tombstoned while "
        << "libdebuggerd_client: received packet of unexpected length from tombstoned: expected "
                  "reading initial response: expected "
               << sizeof(response) << ", received " << rc;
               << sizeof(response) << ", received " << rc;
    return false;
    return false;
  }
  }
@@ -164,11 +168,15 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int


  rc = TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC));
  rc = TEMP_FAILURE_RETRY(recv(set_timeout(sockfd.get()), &response, sizeof(response), MSG_TRUNC));
  if (rc == 0) {
  if (rc == 0) {
    LOG(ERROR) << "libdebuggerd_client: failed to read response from tombstoned: timeout reached?";
    LOG(ERROR) << "libdebuggerd_client: failed to read status response from tombstoned: "
                  "timeout reached?";
    return false;
  } else if (rc == -1) {
    PLOG(ERROR) << "libdebuggerd_client: failed to read status response from tombstoned";
    return false;
    return false;
  } else if (rc != sizeof(response)) {
  } else if (rc != sizeof(response)) {
    LOG(ERROR)
    LOG(ERROR) << "libdebuggerd_client: received packet of unexpected length from tombstoned while "
      << "libdebuggerd_client: received packet of unexpected length from tombstoned: expected "
                  "reading confirmation response: expected "
               << sizeof(response) << ", received " << rc;
               << sizeof(response) << ", received " << rc;
    return false;
    return false;
  }
  }