Merge "adbconnection: delete unnecessary darwin workaround." am: 04e9d07490 am: 7bdf442375

Change-Id: Id497d2c061d183e5fae9700ce0cd12db978e4cfd
This commit is contained in:
Treehugger Robot 2020-04-18 00:23:30 +00:00 committed by Automerger Merge Worker
commit 891bb8d9d1

View file

@ -122,16 +122,7 @@ AdbConnectionClientContext* adbconnection_client_new(
return nullptr;
}
#if defined(__APPLE__)
ctx->control_socket_.reset(socket(AF_UNIX, SOCK_SEQPACKET, 0));
// TODO: find a better home for all these copies of the mac CLOEXEC workaround.
if (int fd = ctx->control_socket_.get(), flags = fcntl(fd, F_GETFD);
flags != -1 && (flags & FD_CLOEXEC) == 0) {
fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
}
#else
ctx->control_socket_.reset(socket(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0));
#endif
if (ctx->control_socket_ < 0) {
PLOG(ERROR) << "failed to create Unix domain socket";
return nullptr;