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

Commit 7b1cbe1d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "root_canal: Add CLOSE_N_EXEC flag for rootcanal" am: 2ab52180 am:...

Merge "root_canal: Add CLOSE_N_EXEC flag for rootcanal" am: 2ab52180 am: 68385481 am: ba8fd753 am: 2bd0f79a am: c8ebb44f

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1844702

Change-Id: I19b6e52dae5420dd3293361c83f7077416bc8e08
parents 16b052b3 c8ebb44f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ class AsyncManager::AsyncFdWatcher {
    }
    // set up the communication channel
    int pipe_fds[2];
    if (pipe2(pipe_fds, O_NONBLOCK)) {
    if (pipe2(pipe_fds, O_NONBLOCK | O_CLOEXEC)) {
      LOG_ERROR(
          "%s:Unable to establish a communication channel to the reading "
          "thread",
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ PosixAsyncSocketConnector::ConnectToRemoteServer(
    const std::chrono::milliseconds timeout) {
  LOG_INFO("Connecting to %s:%d in %d ms", server.c_str(), port,
           (int)timeout.count());
  int socket_fd = socket(AF_INET, SOCK_STREAM, 0);
  int socket_fd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
  std::shared_ptr<PosixAsyncSocket> pas =
      std::make_shared<PosixAsyncSocket>(socket_fd, am_);

+3 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ PosixAsyncSocketServer::PosixAsyncSocketServer(int port, AsyncManager* am)
  struct sockaddr_in listen_address {};
  socklen_t sockaddr_in_size = sizeof(struct sockaddr_in);

  OSI_NO_INTR(listen_fd = socket(AF_INET, SOCK_STREAM, 0));
  OSI_NO_INTR(listen_fd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0));
  if (listen_fd < 0) {
    LOG_INFO("Error creating socket for test channel.");
    return;
@@ -99,7 +99,8 @@ bool PosixAsyncSocketServer::Connected() {

void PosixAsyncSocketServer::AcceptSocket() {
  int accept_fd = 0;
  OSI_NO_INTR(accept_fd = accept(server_socket_->fd(), NULL, NULL));
  OSI_NO_INTR(accept_fd =
                  accept4(server_socket_->fd(), NULL, NULL, SOCK_CLOEXEC));

  if (accept_fd < 0) {
    LOG_INFO("Error accepting test channel connection errno=%d (%s).", errno,