summaryrefslogtreecommitdiffstats
path: root/adbconnection/adbconnection.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2018-06-04 14:14:19 -0700
committerAlex Light <allight@google.com>2018-06-04 14:23:48 -0700
commit54f535a3b43186727ff84fb4d604f6c57473d8ce (patch)
tree623ba6af36ce230ed2484f66d3fe8c3a03c59682 /adbconnection/adbconnection.cc
parentebf5902272613d8bb563ae312ec5ce2580a59bb7 (diff)
downloadplatform_art-54f535a3b43186727ff84fb4d604f6c57473d8ce.tar.gz
platform_art-54f535a3b43186727ff84fb4d604f6c57473d8ce.tar.bz2
platform_art-54f535a3b43186727ff84fb4d604f6c57473d8ce.zip
Pass SOCK_CLOEXEC to adb socket.
We were not passing CLOEXEC to the adb-socket in adbconnection. This could lead to extra (unusable) jdwp PIDs in adb jdwp in some circumstances. Test: Build an app with wrap.sh. adb jdwp on a userdebug device. Ensure pid of wrap.sh is not present in list. Bug: 109505014 Change-Id: Icd41bf037666d6abe35897681aed98b00fb290ac
Diffstat (limited to 'adbconnection/adbconnection.cc')
-rw-r--r--adbconnection/adbconnection.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc
index 8cd0d8bc9fd..d399c2a25ce 100644
--- a/adbconnection/adbconnection.cc
+++ b/adbconnection/adbconnection.cc
@@ -489,7 +489,7 @@ bool AdbConnectionState::SetupAdbConnection() {
int sleep_ms = 500;
const int sleep_max_ms = 2*1000;
- android::base::unique_fd sock(socket(AF_UNIX, SOCK_SEQPACKET, 0));
+ android::base::unique_fd sock(socket(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0));
if (sock < 0) {
PLOG(ERROR) << "Could not create ADB control socket";
return false;