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

Commit 5d7969b5 authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

Merge "liblog: remove code checking for fd = 0"

parents c48c2afa 29d0e893
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ static int socket_local_client(const std::string& name, int type) {
  strlcpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path));

  int fd = socket(AF_LOCAL, type | SOCK_CLOEXEC, 0);
  if (fd == 0) {
  if (fd == -1) {
    return -1;
  }

@@ -337,12 +337,6 @@ static int logdOpen(struct android_log_logger_list* logger_list,
  }

  sock = socket_local_client("logdr", SOCK_SEQPACKET);
  if (sock == 0) {
    /* Guarantee not file descriptor zero */
    int newsock = socket_local_client("logdr", SOCK_SEQPACKET);
    close(sock);
    sock = newsock;
  }
  if (sock <= 0) {
    if ((sock == -1) && errno) {
      return -errno;