| commit | fbae525312542c4f1ae2c0c0b5c8a826dd71dc97 | [log] [tgz] |
|---|---|---|
| author | Steven Moreland <smoreland@google.com> | Fri Apr 16 00:01:45 2021 +0000 |
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Apr 16 00:01:45 2021 +0000 |
| tree | 07c214e7cdb406cdf00ba53e726e9bfbc881c0d6 | |
| parent | 806a1d503ef47455e83959bb2c67080ae89605e2 [diff] | |
| parent | 7e4fb7ca278407136a2caf31bcbead87631e79a6 [diff] |
Merge "binderRpcTest: use TMPDIR" am: 7e4fb7ca27 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1675955 Change-Id: I71b53af14c29d7bf8bdf60a8cd7ad9e135a1983c
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp index a51c987..3340293 100644 --- a/libs/binder/tests/binderRpcTest.cpp +++ b/libs/binder/tests/binderRpcTest.cpp
@@ -199,13 +199,8 @@ static std::string allocateSocketAddress() { static size_t id = 0; - static bool gUseTmp = access("/tmp/", F_OK) != -1; - - if (gUseTmp) { - return "/tmp/binderRpcTest_" + std::to_string(id++); - } else { - return "/dev/binderRpcTest_" + std::to_string(id++); - } + std::string temp = getenv("TMPDIR") ?: "/tmp"; + return temp + "/binderRpcTest_" + std::to_string(id++); }; struct ProcessConnection {