summaryrefslogtreecommitdiffstats
path: root/libsysutils
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-04-01 22:31:40 -0700
committerJeff Sharkey <jsharkey@android.com>2015-04-01 22:31:40 -0700
commit55fd316ea798f2c77ad80def9f9b50d59391f1c2 (patch)
tree857902fbdb319593a8109dd5700f4a1446952738 /libsysutils
parent25775e8e638d9d323c2dbac6d770092b920a5360 (diff)
downloadsystem_core-55fd316ea798f2c77ad80def9f9b50d59391f1c2.tar.gz
system_core-55fd316ea798f2c77ad80def9f9b50d59391f1c2.tar.bz2
system_core-55fd316ea798f2c77ad80def9f9b50d59391f1c2.zip
Give SocketListener some FD_CLOEXEC.
Sockets love FD_CLOEXEC. Bug: 19993667 Change-Id: I0d72a27e0f46b79843bb91ed48ebaf1c89484fd2
Diffstat (limited to 'libsysutils')
-rw-r--r--libsysutils/src/SocketListener.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libsysutils/src/SocketListener.cpp b/libsysutils/src/SocketListener.cpp
index 527a6a0a3..3011ed7a8 100644
--- a/libsysutils/src/SocketListener.cpp
+++ b/libsysutils/src/SocketListener.cpp
@@ -86,6 +86,7 @@ int SocketListener::startListener(int backlog) {
return -1;
}
SLOGV("got mSock = %d for %s", mSock, mSocketName);
+ fcntl(mSock, F_SETFD, FD_CLOEXEC);
}
if (mListen && listen(mSock, backlog) < 0) {
@@ -212,6 +213,7 @@ 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);