Merge "Clean up CLOEXEC in SocketListener." am: ed83cfba68

am: f5a2f6e963

* commit 'f5a2f6e963b4c82adbb129b2df460594524ebedf':
  Clean up CLOEXEC in SocketListener.
This commit is contained in:
Elliott Hughes 2016-02-23 18:51:22 +00:00 committed by android-build-merger
commit 773e8c5e7c

View file

@ -206,7 +206,7 @@ void SocketListener::runListener() {
do {
alen = sizeof(ss);
c = accept(mSock, addrp, &alen);
c = accept4(mSock, addrp, &alen, SOCK_CLOEXEC);
SLOGV("%s got %d from accept", mSocketName, c);
} while (c < 0 && errno == EINTR);
if (c < 0) {
@ -214,7 +214,6 @@ void SocketListener::runListener() {
sleep(1);
continue;
}
fcntl(c, F_SETFD, FD_CLOEXEC);
pthread_mutex_lock(&mClientsLock);
mClients->push_back(new SocketClient(c, true, mUseCmdNum));
pthread_mutex_unlock(&mClientsLock);