summaryrefslogtreecommitdiffstats
path: root/libsysutils/src
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2019-04-10 12:01:34 +0900
committerMaciej Żenczykowski <maze@google.com>2019-05-08 21:02:57 -0700
commitf38e182fbfb0dbdde24c8d7a8c653d2046d12d39 (patch)
tree6d9bc50d58b60aa7ecc97cc1939952f198d237ec /libsysutils/src
parentb562e685037e395b0526a9262977bb73318ff994 (diff)
downloadsystem_core-f38e182fbfb0dbdde24c8d7a8c653d2046d12d39.tar.gz
system_core-f38e182fbfb0dbdde24c8d7a8c653d2046d12d39.tar.bz2
system_core-f38e182fbfb0dbdde24c8d7a8c653d2046d12d39.zip
Make the SocketListener control pipe O_CLOEXEC.
Children of processes that use SocketListener should not be able to stop the SocketListener. Test: builds, boots Test: atest libsysutils_tests Test: atest --test-mapping system/netd Bug: 131268436 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I64898d9966f62004468b8e8a43b59be4a81a8cc4 Merged-In: I64898d9966f62004468b8e8a43b59be4a81a8cc4 (cherry picked from commit dae0195380686dbec450e298f4acf47b5f9576e6)
Diffstat (limited to 'libsysutils/src')
-rw-r--r--libsysutils/src/SocketListener.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsysutils/src/SocketListener.cpp b/libsysutils/src/SocketListener.cpp
index ded5adb6d..97806068e 100644
--- a/libsysutils/src/SocketListener.cpp
+++ b/libsysutils/src/SocketListener.cpp
@@ -95,7 +95,7 @@ int SocketListener::startListener(int backlog) {
} else if (!mListen)
mClients[mSock] = new SocketClient(mSock, false, mUseCmdNum);
- if (pipe(mCtrlPipe)) {
+ if (pipe2(mCtrlPipe, O_CLOEXEC)) {
SLOGE("pipe failed (%s)", strerror(errno));
return -1;
}