Clean up CLOEXEC in SocketListener.
Change-Id: I9811573a4b64ef2e38f1e4ba17158911b05a5f34
This commit is contained in:
parent
fbaefc4d9d
commit
fcd7295962
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue